Root in Visual C++

GENTIT Francois-Xavier DAPNIA (GENTIT@DAPNIA.CEA.FR)
Tue, 8 Sep 1998 16:09:23 +0200


Hello ROOT authors,

Recently I got a PC and was happy by the idea of working with ROOT
on PC having a machine for me alone. Unfortunatly, I did not succeed
100%. First this is what I succeed in :

(1) - installation of ROOT on the PC.
(2) - installation of my code under Visual C++ with a makefile. I
could compile my code, link it with the ROOT libraries and execute it
ok.

This is what went wrong :

I had the surprise to discover that Visual C++ disables the debugger
when one enter in Visual C++ with a makefile ( which is a non-standard
way of using Visual C++ ). So I tried to make, very painfully, a
"developer studio project". I had to find which were the libraries
behind the "guilibsdll", how to indicate to Visual C++ where to find the
include files, and so on. I never succeed in linking my code that way. I
give at the end of this message the kind of error messages I get, but I
think it is much too complicate to try to solve this kind of problem by
mail, so the aim of this mail is to kindly ask the Authors of ROOT to
provide on the web some documentation about the use of ROOT in Visual
C++. For me the use of a debugger is essential and I return to unix on
HP, where the debugger dde is working quite well, until I know how to
get the debugger of Visual C++ to work. Thanks a lot if you can help me.

F.X. Gentit
DAPNIA/SPP CEN Saclay
tel : 01 69 08 30 38

This is the kind of error messages I get when trying to link my code
in a true "developer studio project" in Visual C++ :

messages if one take as libraries :

msvcrt.lib oldnames.lib kernel32.lib ws2_32.lib mswsock.lib
advapi32.lib \
user32.lib gdi32.lib comdlg32.lib winspool.lib msvcirt.lib

Linking...
libcid.lib(ostream.obj) : error LNK2005: "public: class ostream \
& __thiscall ostream::operator<<(char const *)"
(??6ostream@@QAEAAV0@PBD@Z)\
already defined in msvcirt.lib(MSVCIRT.dll)
libcid.lib(ostream.obj) : error LNK2005: "public: class ostream \
& __thiscall ostream::flush(void)" (?flush@ostream@@QAEAAV1@XZ) \
already defined in msvcirt.lib(MSVCIRT.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in
msvcrt.lib(MSVCRT.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: __exit already defined in
msvcrt.lib(MSVCRT.dll)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in
msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in
msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in
msvcrt.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in
msvcrt.lib(cinitexe.obj)
LIBCD.lib(strcat.obj) : error LNK2005: _strcat already defined in
msvcrt.lib(MSVCRT.dll)
LIBCD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in
msvcrt.lib(MSVCRT.dll)
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other
libs; use /NODEFAULTLIB:library
TFitMeas.obj : error LNK2001: unresolved external symbol "class TRandom
* gRandom" (?gRandom@@3PAVTRandom@@A)
TOpticMaterial.obj : error LNK2001: unresolved external symbol "class
TRandom * gRandom" (?gRandom@@3PAVTRandom@@A)
msvcrt.lib(crtexew.obj) : error LNK2001: unresolved external symbol
_WinMain@16
Debug/litran.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

litran.exe - 14 error(s), 1 warning(s)

messages if one takes as library :

msvcrt.lib oldnames.lib kernel32.lib ws2_32.lib mswsock.lib
advapi32.lib \
user32.lib gdi32.lib comdlg32.lib winspool.lib msvcirt.lib
/NODEFAULTLIB

Linking...
TPolynom.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
TRevetment.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
ThinSlice.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
TLitGlob.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
TMeas.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
TOpticMaterial.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
T3Vector.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
TComplex.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
TFace.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
TFitMeas.obj : error LNK2001: unresolved external symbol "class
ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
T3Vector.obj : error LNK2001: unresolved external symbol "class
istream_withassign cin" (?cin@@3Vistream_withassign@@A)
TComplex.obj : error LNK2001: unresolved external symbol "class
istream_withassign cin" (?cin@@3Vistream_withassign@@A)
TFitMeas.obj : error LNK2001: unresolved external symbol "class TRandom
* gRandom" (?gRandom@@3PAVTRandom@@A)
TOpticMaterial.obj : error LNK2001: unresolved external symbol "class
TRandom * gRandom" (?gRandom@@3PAVTRandom@@A)
msvcrt.lib(crtexew.obj) : error LNK2001: unresolved external symbol
_WinMain@16
Debug/litran.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

litran.exe - 16 error(s), 0 warning(s)