Linux build error and fix with the latest SVN

libolt

09-09-2007 20:16:15

I finally got some free time after getting back into town to try building the latest QuickGUI from subversion under linux and I ran into the following error:


/usr/bin/cmake -E cmake_progress_report /home/libolt/builds/quickgui-svn/CMakeFiles 22
[ 3%] Building CXX object QuickGUI/src/CMakeFiles/QuickGUI-0.9.6.dir/QuickGUIText.o
/usr/bin/c++ -DQuickGUI_0_9_6_EXPORTS -fPIC -I/home/libolt/builds/quickgui-svn/QuickGUI/src/../include -I/home/libolt/builds/quickgui-svn/QuickGUI/src/-DOGRE_GUI_GLX -I/home/libolt/builds/quickgui-svn/QuickGUI/src/-DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/include/OGRE -o QuickGUI/src/CMakeFiles/QuickGUI-0.9.6.dir/QuickGUIText.o -c /home/libolt/builds/quickgui-svn/QuickGUI/src/QuickGUIText.cpp
/home/libolt/builds/quickgui-svn/QuickGUI/src/QuickGUIText.cpp: In member function ‘void QuickGUI::Text::_setCaptionHorizontal(const Ogre::UTFString&)’:
/home/libolt/builds/quickgui-svn/QuickGUI/src/QuickGUIText.cpp:125: error: ambiguous overload for ‘operator+’ in ‘it + i’
/usr/include/OGRE/OgreUTFString.h:453: note: candidates are: Ogre::UTFString::_const_fwd_iterator Ogre::UTFString::_const_fwd_iterator::operator+(size_t)
/usr/include/OGRE/OgreUTFString.h:459: note: Ogre::UTFString::_const_fwd_iterator Ogre::UTFString::_const_fwd_iterator::operator+(long int)
/home/libolt/builds/quickgui-svn/QuickGUI/src/QuickGUIText.cpp:127: error: ambiguous overload for ‘operator+’ in ‘it + i’
/usr/include/OGRE/OgreUTFString.h:453: note: candidates are: Ogre::UTFString::_const_fwd_iterator Ogre::UTFString::_const_fwd_iterator::operator+(size_t)
/usr/include/OGRE/OgreUTFString.h:459: note: Ogre::UTFString::_const_fwd_iterator Ogre::UTFString::_const_fwd_iterator::operator+(long int)
make[2]: *** [QuickGUI/src/CMakeFiles/QuickGUI-0.9.6.dir/QuickGUIText.o] Error 1
make[2]: Leaving directory `/home/libolt/builds/quickgui-svn'
make[1]: *** [QuickGUI/src/CMakeFiles/QuickGUI-0.9.6.dir/all] Error 2
make[1]: Leaving directory `/home/libolt/builds/quickgui-svn'
make: *** [all] Error 2
l


Now I traced the problem to line 125 of QuickGUIText.cpp:


for(int i = 0; (it+i) != text.end(); i++)



It appears that Ogre wants a long int instead of int passed to: Ogre::UTFString::_const_fwd_iterator::operator+().

So I replaced line 125: with the following:


for(long int i = 0; (it+i) != text.end(); i++)



Now everything compiles happily. If you could test this on windows to ensure it works properly and include the fix or another work around, it would be appreciated.

I will also be working on revamping the cmake build system over the next couple of days. Would you be willing to include it in your tree once I have it in a more usable shape? That way linux users can pull QuickGUI from subversion and build it. I'll do my best to track the subversion tree and submit updates as it changes and evolves.

Mike

kungfoomasta

09-09-2007 20:28:29

I added in the use of "long" there, and it builds correctly, but I can't test at the moment.

Sent you a PM. :)