GUI on Visual c++

Dear all,
I have a problem with GUI on visual C++.

I have Visual c++ 2010 express edition and Root 5.34
I set environment library to work with ROOT header in visual c++ and it works (I can use TCanvas, TRandom etc…etc…).
The only problem is that I am not capable to use GUI with visual C++.

I already saw tons of topics with the same problem but I cannot fix mine.

When I try to “Debug” with VC++ I get:

  1. MyMainFrame.obj : error LNK2001: unresolved external symbol “public: virtual void __thiscall MyMainFrame::ShowMembers(class TMemberInspector &)” (?ShowMembers@MyMainFrame@@UAEXAAVTMemberInspector@@@Z)

  2. MyMainFrame.obj : error LNK2001: unresolved external symbol “public: virtual void __thiscall MyMainFrame::Streamer(class TBuffer &)” (?Streamer@MyMainFrame@@UAEXAAVTBuffer@@@Z)

  3. MyMainFrame.obj : error LNK2019: unresolved external symbol “public: static class TClass * __cdecl MyMainFrame::Class(void)” (?Class@MyMainFrame@@SAPAVTClass@@XZ) referenced in function "public: virtual class TClass * __thiscall MyMainFrame::IsA(void)const " (?IsA@MyMainFrame@@UBEPAVTClass@@XZ)

  4. MyMainFrame.obj : error LNK2019: unresolved external symbol “class ROOT::TGenericClassInfo * __cdecl ROOT::GenerateInitInstance(class MyMainFrame const *)” (?GenerateInitInstance@ROOT@@YAPAVTGenericClassInfo@1@PBVMyMainFrame@@@Z) referenced in function “void __cdecl ROOT::`dynamic initializer for ‘R__dummyintdefault8’’(void)” (??__ER__dummyintdefault8@ROOT@@YAXXZ).

Could you help me??

Thanks.
MyMainFrame.h (749 Bytes)
MyMainFrame.cpp (1.26 KB)
main.cpp (324 Bytes)
Gui_Link_Def.h (68 Bytes)

Does it work if you comment out line
ClassDef(MyMainFrame,0)
from class MyMainFrame?

Hi,

You have to generate the dictionary for your class using GuiLinkDef.h (instead of Gui_Link_Def.h):

And then compile MyMainFrameDict.cxx and link MyMainFrameDict.obj within your project. For example:

Cheers, Bertrand.

Dear Bertrand,
it works!!!
Thanks a lot.

I don’t know if there is a way to write “SOLVED” in the post-title but…it is SOLVED!!!

Thanks again.

Cheers.

Alberto

You’re welcome. And I flagged it as solved (there is a small check box on top right of the post) :slight_smile:

Cheers, Bertrand.