[ROOT] Root and windows 2000+visual c++ + visual c++

From: Guido Gagliardi (Guido.Gagliardi@cern.ch)
Date: Mon Aug 12 2002 - 11:04:52 MEST


Hi 

I've managed to compile and link my root-based analysis program under
windows 2000 + visual c++. 
The main problem i encountered is the linking of libraries. I link the
following libraries:

libcore.lib
libgpad.lib
libgraf.lib
libgraf3d.lib
libgui.lib
libhist.lib
libmatrix.lib
libphysics.lib
libpostscript.lib
librint.lib
libtree.lib
libcint.lib

in both release (that is the default visualc++ Release settings optimized
for speed) and Debug (again the default visualc++) configurations. I also
have to ignore the libcd.lib default library in both configurations. 
The result is that i have the following error in link (Release version):

Generating Code...
Linking...
msvcirt.lib(MSVCIRT.dll) : warning LNK4006: "class ostream & __cdecl
endl(class ostream &)" (?endl@@YAAAVostream@@AAV1@@Z) already defined in
libCore.lib(TBox.obj); second definition ignored

and the similar error in Debug version:

Linking...
msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "public: class ostream &
__thiscall ostream::operator<<(class ostream & (__cdecl*)(class ostream
&))" (??6ostream@@QAEAAV0@P6AAAV0@AAV0@@Z@Z) already defined in
libCore.lib(TBox.obj)
msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "class ostream & __cdecl
endl(class ostream &)" (?endl@@YAAAVostream@@AAV1@@Z) already defined in
libCore.lib(TBox.obj)
../ana.dll : fatal error LNK1169: one or more multiply defined symbols
found
Error executing link.exe.

This happens when i am trying to build a DLL i would like to load
interactively in CINT.

Peeking at the code i found out that in iostrm.h the iostream operator are
defined, and that they are included in the code with #include
"Riostream.h" depending on preprocessor symbol definition. It looks like 
the library i have to use in visualc++ is in conflict with libcore.lib. Is
there anything i can do? Someone has had the same problem and has solved
out it? 
I am using in my code <iostream.h> instead of <iostream>. Is there any
way to use <iostream> (I like the std::getline function...)? That is, is
there anyset of windows root libraries that uses <iostream> insted of
<iostream.h>?


Guido Gagliardi
INFN Genova



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:04 MET