Problems w/ same simple test GUI but now in visual studio'05

hi folks,

this is a sort of continuation of
http://root.cern.ch/phpBB2/viewtopic.php?t=3828

working on tabbed GUI to display STAR TOF data for a high school outreach project… got things to build fine in windows XP Pro while using cygwin/gcc… now trying to build the same code w/ visual studio express 2005. i believe i have everything installed correctly (no previous .Net installed, no spaces in any path, etc etc)… root itself (i installed the binaries, v. 5.12.00) works fine from the command prompt…
macosx and linux builds always work first time so i think the basic code is o.k. at some level…

in the MS visual studio environment, i can build and run a muster example project that i found in this forum. i even messed with it, adding some text output to the console and and a draw statement which nicely popped up a graphics canvas and plotted the right thing…
(i did notice a run-time problem when debug-building - “MSVCR80D.dll missing” - but found on the net that since my windows drive is FAT32 i need to turn off incremental linking. this solved it).
anyway the muster example i have seems to build/work fine…

but then i try to build the same simple test GUI that was so informative for the previous thread…
MSVS 2005 builds the dictionary and compiles all the sources fine apparently, but chokes hard on the link step. partial output below, and full output w/ verbosity during the link step is in the file LinkErrorsWithVerbosity.txt that’s attached.
seeing unresolved externals for things including the word ‘Streamer’ etc, i thought for a while that the link step wasn’t seeing the object file from the compilation of the dictionary… but in the verbose info it seems that the …Dict.obj file is known to the linker.

i tried to compare the Project Properties for the muster example and my test GUI… i saw some differences, but changing my test project’s properties to match muster’s didn’t solve the link errors. (aside: is there some way to compare vcproj files? switching back and forth between the projects then navigating the property setting trees on each side seems cumbersome - i feel like i must’ve missed something(s)…)

the project directory for the muster example as i have it (worky) and the simple test gui (no worky) are also attached…

any ideas? any wild guess appreciated… many thanks in advance, cheers
bill

1>------ Build started: Project: test, Configuration: Debug Win32 ------ 1>Building ROOT Dictionary 1>Compiling... 1>testDict.cpp 1>test.cpp 1>main.cpp 1>Generating Code... 1>Linking... 1> Creating library C:\MySoftware\test\Debug\test.lib and object C:\MySoftware\test\Debug\test.exp 1>main.obj : error LNK2019: unresolved external symbol "public: class TGWindow const * __thiscall TGClient::GetRoot(void)const " (?GetRoot@TGClient@@QBEPBVTGWindow@@XZ) referenced in function _main 1>test.obj : error LNK2001: unresolved external symbol "public: class TGWindow const * __thiscall TGClient::GetRoot(void)const " (?GetRoot@TGClient@@QBEPBVTGWindow@@XZ) 1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class TGClient * gClient" (__imp_?gClient@@3PAVTGClient@@A) 1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class TGClient * gClient" (__imp_?gClient@@3PAVTGClient@@A) referenced in function __unwindfunclet$??0test@@QAE@PBVTGWindow@@II@Z$0 1>test.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall TGMainFrame::~TGMainFrame(void)" (??1TGMainFrame@@UAE@XZ) referenced in function "public: virtual __thiscall test::~test(void)" (??1test@@UAE@XZ) 1>test.obj : error LNK2019: unresolved external symbol "public: __thiscall TGTextButton::TGTextButton(class TGWindow const *,char const *,char const *,int,unsigned long,unsigned long,unsigned int)" (??0TGTextButton@@QAE@PBVTGWindow@@PBD1HKKI@Z) referenced in function "public: __thiscall test::test(class TGWindow const *,unsigned int,unsigned int)" (??0test@@QAE@PBVTGWindow@@II@Z) ... 1>C:\MySoftware\test\Debug\test.exe : fatal error LNK1120: 76 unresolved externals 1>Build log was saved at "file://c:\MySoftware\test\Debug\BuildLog.htm" 1>test - 138 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
test.zip (456 KB)
muster2.zip (663 KB)
LinkErrorsWithVerbosity.txt (87.7 KB)

Hi Bill,
you need to link with libGui, too.
Axel.

Hi Bill,

You may also want to add dictionary generation in your project :
In Project->Properties->Build Events->Pre-Build Event, add this command line :
rootcint -f testDict.cpp -c test.h testLinkDef.h
And don’t forget to use “Multi-threaded Debug DLL (/MDd)” when building your project in Debug mode.

Cheers,
Bertrand.

slaps forehead

that was it of course. thanks axel!!!
cheers

[quote=“bellenot”]Hi Bill,

You may also want to add dictionary generation in your project :
In Project->Properties->Build Events->Pre-Build Event, add this command line :
rootcint -f testDict.cpp -c test.h testLinkDef.h
And don’t forget to use “Multi-threaded Debug DLL (/MDd)” when building your project in Debug mode.

Cheers,
Bertrand.[/quote]

Hi Bertrand - thanks!
those things i’m doing, although i worried for a while that i was doing the dictionary wrong… i tried all sort of silly things there until i decided it was o.k. after all…

BTW - one small question - why don’t i need an X11 client to run the GUI when building under MSVC, but i do when running under any *NIX?

many thanks again… cheers

Hi Bill,

On Windows, the GUI is using native Win32 GDI (Graphical Device Interface). It is not X11 client - server architecture, as used on Linux.

Cheers,
Bertrand.