latest SVN and linux

libolt

08-02-2008 18:33:09

I'm afraid I'm running into another issue with the latest SVN update. GCC seems to be having trouble finding the definition of the QuickGUI::Panel class even though QuicKGUIPanel.h is included in QuickGUISheet.h


/usr/bin/c++ -DQuickGUI_EXPORTS -fPIC -I/home/libolt/builds/quickgui/QuickGUI/src/../include -I/home/libolt/builds/quickgui/QuickGUI/src/-DOGRE_GUI_gtk -I/home/libolt/builds/quickgui/QuickGUI/src/-DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/local/include -I/usr/local/include/OGRE -o QuickGUI/src/CMakeFiles/QuickGUI.dir/QuickGUIProgressBar.o -c /home/libolt/builds/quickgui/QuickGUI/src/QuickGUIProgressBar.cpp
/home/libolt/builds/quickgui/QuickGUI/src/../include/QuickGUISheet.h:21: error: invalid use of undefined type ‘struct QuickGUI::Panel’
/home/libolt/builds/quickgui/QuickGUI/src/../include/QuickGUIForwardDeclarations.h:54: error: forward declaration of ‘struct QuickGUI::Panel’
/home/libolt/builds/quickgui/QuickGUI/src/QuickGUIProgressBar.cpp: In member function ‘void QuickGUI::ProgressBar::_modifyBarTexture(float)’:
/home/libolt/builds/quickgui/QuickGUI/src/QuickGUIProgressBar.cpp:118: warning: converting to ‘int’ from ‘float’
/home/libolt/builds/quickgui/QuickGUI/src/QuickGUIProgressBar.cpp:120: warning: converting to ‘int’ from ‘float’
/home/libolt/builds/quickgui/QuickGUI/src/QuickGUIProgressBar.cpp:156: warning: converting to ‘int’ from ‘float’
/home/libolt/builds/quickgui/QuickGUI/src/QuickGUIProgressBar.cpp:158: warning: converting to ‘int’ from ‘float’
make[2]: *** [QuickGUI/src/CMakeFiles/QuickGUI.dir/QuickGUIProgressBar.o] Error 1
make[2]: Leaving directory `/home/libolt/builds/quickgui'
make[1]: *** [QuickGUI/src/CMakeFiles/QuickGUI.dir/all] Error 2
make[1]: Leaving directory `/home/libolt/builds/quickgui'
make: *** [all] Error 2



Also I have been working on setting up Visual Studio 2008 on my windows boxes as my default compiler. So naturally I'm trying to make it work with the CMake build system. :) Well I am getting a very similar error with VC++ as well. This is building via NMake.

If I import the project files into visual studio 2008 everything builds properly.

Cheers,

Mike

kungfoomasta

08-02-2008 19:19:31

I wonder if the Forward declarations are somehow interfering with the include to Panel.h? That's not something that I have changed recently, the Sheet has always inheritted from Panel class.

For the ProgressBar, I don't have the code on hand, but it looks like some static_cast<float> calls will supress those warnings?

Kali

08-02-2008 19:28:09

Well the problem with those forward declaration errors in linux every time is that _PRECOMP is set in QuickGUIPrecompiledHeaders.h when you build it under windows and is not set when you build it under linux. Therefore, a lot of headers automatically included in windows are not automatically included under linux.

Remove the #ifdef _PRECOMP #endif from QuickGUIPrecompiledHeaders.h and those errors will magically dissapear.

(read http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6329)

Offcource this way the precompiled header won't be a precompiled header under linux, but a regular header. Gcc does support a precompiled header, but you'd have to look up the proper syntax, i never used it.

libolt

08-02-2008 19:44:14

Kali's suggestion does indeed fix the problem. However what I have done for now is added a DEFINE_SYMBOL _PRECOMP to the QuickGUI/src/CMakeLists.txt and this also allow everything to compile.

I am going to look and see how to use GCC's precompiled header support.

For now I'll commit the fixed CMakeLists.txt and hopefully that'll prevent further issues until I can figure out the precompiled header syntax.

Mike

kungfoomasta

08-02-2008 20:23:12

I'm actually not a fan of using the Precompiled header file, I'd rather include the bare minimum required in each file. This is some additional work to implement, but it's much more organized IMO.

Is it acceptable to remove the Precompiled Header? I realize its purpose is to reduce compilation time, but the build times were never very long on my laptop to begin with.

libolt

08-02-2008 20:29:31

That's fine by me. It will probably also fix my win32/nmake build problem. :)

Mike

thecaptain

10-02-2008 19:08:08

I'd kind of prefer to have the option of using it, since I have noticed it sped up compilation a lot for me. Perhaps you could just remove the _PRECOMP symbol in your project file and make sure it builds fine that way. Then those of us who like it can still use it. :D