STANDALONE compile of ..\test\guitest.cxx under VC++9

Hi,

I work under WinXP with VC++9
ROOT version is: 5.27/02, VC++9/MSI/Debug

I am trying to compile a STANDALONE version of $(ROOTSYS)\test\guitext.cxx under VC++9, I got some errors.

  1. With VC++9, compile and link of this program is success and the .exe file run well, but each time when I click the “Cancel” button (or click the ‘close’ button on the top right corner) of the “TestDialog” Frame (form the menu test->Dialog) the .exe file crashed and give an error as following:
Debug Assertion Failed!
Program: ...\guitest.exe
File: ..\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Line:52
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
For information on how your program can cause an assertion failure, see the Visual C++ documentations on asserts.

I tried the “test” code download from http://root.cern.ch/phpBB3//viewtopic.php?t=1242 ,(it is VC7, I choose to convert it to VC++9 automatically) the error is the same. Set Release or Degug in VC++9, the error is the same.

  1. I tried to compile the $(ROOTSYS)\test\guitext.cxx with ACLiC, I got the following errors:
Error in <TileFrame>: TileFrame inherits from TObject but does not have its own ClassDef
Error in <TestMainFrame>: TestMainFrame inherits from TObject but does not have its own ClassDef
Error in <TestDialog>: TestDialog inherits from TObject but does not have its own ClassDef
Error in <TestMsgBox>: TestMsgBox inherits from TObject but does not have its own ClassDef
Error in <TestSliders>: TestSliders inherits from TObject but does not have its own ClassDef
Error in <TestShutter>: TestShutter inherits from TObject but does not have its own ClassDef
Error in <TestDirList>: TestDirList inherits from TObject but does not have its own ClassDef
Error in <TestFileList>: TestFileList inherits from TObject but does not have its own ClassDef
Error in <TestProgress>: TestProgress inherits from TObject but does not have its own ClassDef
Error in <EntryTestDlg>: EntryTestDlg inherits from TObject but does not have its own ClassDef
Error in <Editor>: Editor inherits from TObject but does not have its own ClassDef

But even with these errors, the program run well without the error which is stated previously.

If I added ‘ClassDef’ to these ‘class’, I get the following errors:

................
C:\root\test\guitest_cpp_ACLiC_dict.cxx(715) : warning C4356: 'TGTransientFrame::fgIsA' : static data member cannot be initialized via derived class
C:\root\test\guitest_cpp_ACLiC_dict.cxx(719) : error C2509: 'Class_Name' : member function notdeclared in 'TestDialog'
        C:\\root\\test\\guitest.cpp(255) : see declaration of 'TestDialog'
C:\root\test\guitest_cpp_ACLiC_dict.cxx(725) : error C2509: 'ImplFileName' : member function not declared in 'TestDialog'
        C:\\root\\test\\guitest.cpp(255) : see declaration of 'TestDialog'
C:\root\test\guitest_cpp_ACLiC_dict.cxx(731) : error C2509: 'ImplFileLine' : member function not declared in 'TestDialog'
        C:\\root\\test\\guitest.cpp(255) : see declaration of 'TestDialog'
C:\root\test\guitest_cpp_ACLiC_dict.cxx(737) : error C2509: 'Dictionary' : member function not declared in 'TestDialog'
        C:\\root\\test\\guitest.cpp(255) : see declaration of 'TestDialog'
C:\root\test\guitest_cpp_ACLiC_dict.cxx(743) : error C2509: 'Class' : member function not declared in 'TestDialog'
        C:\\root\\test\\guitest.cpp(255) : see declaration of 'TestDialog'
C:\root\test\guitest_cpp_ACLiC_dict.cxx(874) : error C2509: 'Streamer' : member function not declared in 'TestDialog'
        C:\\root\\test\\guitest.cpp(255) : see declaration of 'TestDialog'
C:\root\test\guitest_cpp_ACLiC_dict.cxx(886) : error C2509: 'ShowMembers' : member function not declared in 'TestDialog'
        C:\\root\\test\\guitest.cpp(255) : see declaration of 'TestDialog'
.......................

I refered to http://root.cern.ch/phpBB3//viewtopic.php?p=10192& , however can not solve this problem.

Any help is appreciated!

Thank you!

Hi,

I don’t see any problem with $ROOTSYS/test/guitest.exe. How did you compile it? FYI, there is a nmake makefile in this directory, allowing to build all the test applications with this simple command (in the $ROOTSYS/test directory): "nmake -f Makefile.win32"
Could you try and let me know if it works for you?

Cheers,Bertrand.

Hi Bertrand,

    I compile the guitest.cxx program with VC++9 in the usual way, just New a Project add the source file guitest.cxx, then try to set the parameters in the Properties of the Project, in doing this I try to copy the parameters in the project which was downloaded from [url]http://root.cern.ch/phpBB3//viewtopic.php?t=1242[/url] .  I hope my method is not too much stupid.  :slight_smile: 
   The reason why I want to do it in this way is because Debug my program with VC++ seems easier for me. If it is not complex, would you please kindly give me some advice (or some reference) about how to do compile in this way, if it will take you much time, just forget it. I will give up trying.

I tried the command line “nmake -f Makefile.win32”, it works well, the guitest.exe is ok without any error.

Thank you very much!

Han

Hi Han,

Very good! Then you don’t need to create a Visual Studio project (solution) to be able to debug any application: In Visual Studio, from the menu: File->Open->Project/Solution and select the executable (e.g. guitest.exe)
If you still want to create a Visual Studio solution, you must use the proper compilation flags (the same than the ones used to build ROOT). If you really want to have a project file, I can try to make one for guitest, just let me know.

And BTW, the page (and the files) you’re referring to is too old (e.g. Visual Studio 7 is not supported anymore…)

Cheers, Bertrand.

Hi Bertrand,

If it’s not time consuming, I with my sincere gratitude to ask you to prepare me a project file for guitest, I want to learn more about this.

And, have you meet the 2nd errors which I was stated when compile the …\test\guitest.cxx with ACLiC ?

Thank you very much!

Han

Hi Han,

OK, then I’ll prepare a project file and I’ll post it here.

Well, $ROOTSYS/test/guitest.cxx is a stand-alone application and is not supposed to be used with ACLiC.
You can use the $ROOTSYS/tutorials/gui/guitest.C macro with ACLiC without problem.

Cheers, Bertrand.

Hi Han,

Here is a Visual Studio 9.0 solution for guitest.cxx. Please give it a try and let me know if it works for you.

Cheers, Bertrand.
guitest.tar.gz (23.5 KB)

Hi Bertrand,

I am sorry. It does not work. It gives the same error as I stated in the begaining of this topic. Here I upload a picture to show this error message.

Thank you very much!

Han


Hi Han,

You have to compile guitest with the same configuration than ROOT (Debug/Release). One cannot mix the configurations. I think you downloaded the debug build of ROOT, so you have to compile guitest in debug mode.

Cheers, Bertrand.

Hi Bertrand,

Yes, you are right. I am sorry for making this mistake again.

Thank you very much. You are so warm-hearted.

Best wishes.
Han

No problem! You are very welcome! :slight_smile:
Cheers, Bertrand.