You are not logged in.

#1 2012-04-04 13:25:38

phoenixRO
Member
Registered: 2011-09-15
Posts: 21

updating GCC to 4.7 breaks boost 1.49

I have just updated gcc (and libc) to 4.7.0 and whenever I try to compile something against boost 1.49 I get dozens of linker errors. I noticed that it is a known bug and that boost should be recompiled with the new compiler.

In the meantime, is there any way I could revert gcc to 4.6.x using pacman?

Thanks!

Offline

#2 2012-04-04 14:04:53

krigun
Member
From: Norway
Registered: 2005-06-06
Posts: 122
Website

Re: updating GCC to 4.7 breaks boost 1.49

What linker errors are you getting? I'm linking against boost system and boost thread just fine with gcc 4.7.0.

Offline

#3 2012-04-04 14:06:49

phoenixRO
Member
Registered: 2011-09-15
Posts: 21

Re: updating GCC to 4.7 breaks boost 1.49

`.text._ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED2Ev' referenced in section `.text._ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED1Ev[_ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED1Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o): defined in discarded section `.text._ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED2Ev[_ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED5Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o)
`.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED2Ev' referenced in section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED1Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED1Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o): defined in discarded section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED2Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED5Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o)

Also, apparently g++ 4.7.0 hits hard on the "protected" keyword for classes. Do you have any idea what could be done? smile thanks!

Offline

#4 2012-04-04 14:14:36

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,408
Website

Re: updating GCC to 4.7 breaks boost 1.49

I hear a boost rebuild is on its way.  If you can not wait, rebuild it yourself using ABS.

@krigun: I believe only static linking is affected.

Offline

#5 2012-04-04 22:13:32

krigun
Member
From: Norway
Registered: 2005-06-06
Posts: 122
Website

Re: updating GCC to 4.7 breaks boost 1.49

phoenixRO wrote:
`.text._ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED2Ev' referenced in section
 `.text._ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED1Ev[_ZN5boost16exception_detail19error_info_injector
INS_16bad_lexical_castEED1Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o): defined in discarded section
 `.text._ZN5boost16exception_detail19error_info_injectorINS_16bad_lexical_castEED2Ev[_ZN5boost16exception_detail19error_info_injectorINS_16bad
_lexical_castEED5Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o)
`.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED2Ev' referenced in section 
`.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED1Ev[_ZN5boost16exception_detail10clone
_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED1Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o): defined in discarded section 
`.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_16bad_lexical_castEEEED2Ev[_ZN5boost16exception_detail10clone_implI
NS0_19error_info_injectorINS_16bad_lexical_castEEEED5Ev]' of /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../libboost_graph.a(read_graphviz_new.o)

Sorry - can't help you on this one. Some of the errors GCC spits out when using the boost libraries are hardcore. Often I just sit there, staring at the screen with glazed eyes trying to make out if I forgot a semicolon, or if there is something wrong with the template argument list, or if I'm missing a header, or ... It's often impossible to make this out by the error alone, which is a shame.

phoenixRO wrote:

Also, apparently g++ 4.7.0 hits hard on the "protected" keyword for classes. Do you have any idea what could be done? smile thanks!

Have not had any problems here, what exactly is gcc complaining about?

Allan wrote:

@krigun: I believe only static linking is affected.

Ok, thanks! Been linking with the shared libraries, and everything has been fine.

Offline

#6 2012-04-08 08:05:51

lgro
Member
Registered: 2010-06-02
Posts: 6

Re: updating GCC to 4.7 breaks boost 1.49

Hi,
I have similar problems even after ABS rebuild:

MyGUI (makepkg -s ):

Linking CXX executable ../../bin/Demo_Colour
CMakeFiles/Demo_Colour.dir/ColourPanel.cpp.o: In function `MyGUI::Singleton<MyGUI::LayoutManager>::getInstance()':
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_13LayoutManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_13LayoutManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::LayoutManager>::msInstance'
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_13LayoutManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_13LayoutManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::LayoutManager>::mClassTypeName'
CMakeFiles/Demo_Colour.dir/ColourPanel.cpp.o: In function `MyGUI::Singleton<MyGUI::SkinManager>::getInstance()':
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_11SkinManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_11SkinManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::SkinManager>::msInstance'
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_11SkinManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_11SkinManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::SkinManager>::mClassTypeName'
CMakeFiles/Demo_Colour.dir/ColourPanel.cpp.o: In function `MyGUI::Singleton<MyGUI::Gui>::getInstance()':
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_3GuiEE11getInstanceEv[_ZN5MyGUI9SingletonINS_3GuiEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::Gui>::msInstance'
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_3GuiEE11getInstanceEv[_ZN5MyGUI9SingletonINS_3GuiEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::Gui>::mClassTypeName'
CMakeFiles/Demo_Colour.dir/ColourPanel.cpp.o: In function `MyGUI::Singleton<MyGUI::RenderManager>::getInstance()':
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_13RenderManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_13RenderManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::msInstance'
ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_13RenderManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_13RenderManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::mClassTypeName'
CMakeFiles/Demo_Colour.dir/DemoKeeper.cpp.o: In function `MyGUI::Singleton<MyGUI::ResourceManager>::getInstance()':
DemoKeeper.cpp:(.text._ZN5MyGUI9SingletonINS_15ResourceManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_15ResourceManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::ResourceManager>::msInstance'
DemoKeeper.cpp:(.text._ZN5MyGUI9SingletonINS_15ResourceManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_15ResourceManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::ResourceManager>::mClassTypeName'
../../lib/libCommon.a(BaseManager.cpp.o): In function `MyGUI::Singleton<MyGUI::LayerManager>::getInstance()':
BaseManager.cpp:(.text._ZN5MyGUI9SingletonINS_12LayerManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_12LayerManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::LayerManager>::msInstance'
BaseManager.cpp:(.text._ZN5MyGUI9SingletonINS_12LayerManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_12LayerManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::LayerManager>::mClassTypeName'
../../lib/libCommon.a(BaseManager.cpp.o): In function `MyGUI::Singleton<MyGUI::InputManager>::getInstance()':
BaseManager.cpp:(.text._ZN5MyGUI9SingletonINS_12InputManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_12InputManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::InputManager>::msInstance'
BaseManager.cpp:(.text._ZN5MyGUI9SingletonINS_12InputManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_12InputManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::InputManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o): In function `MyGUI::OgreDataManager::initialise(std::string const&)':
MyGUI_OgreDataManager.cpp:(.text+0x1db): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o): In function `MyGUI::OgreDataManager::shutdown()':
MyGUI_OgreDataManager.cpp:(.text+0x71a): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o): In function `MyGUI::Singleton<MyGUI::DataManager>::~Singleton()':
MyGUI_OgreDataManager.cpp:(.text._ZN5MyGUI9SingletonINS_11DataManagerEED2Ev[_ZN5MyGUI9SingletonINS_11DataManagerEED5Ev]+0x11): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::msInstance'
MyGUI_OgreDataManager.cpp:(.text._ZN5MyGUI9SingletonINS_11DataManagerEED2Ev[_ZN5MyGUI9SingletonINS_11DataManagerEED5Ev]+0x3f): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o): In function `MyGUI::Singleton<MyGUI::DataManager>::Singleton()':
MyGUI_OgreDataManager.cpp:(.text._ZN5MyGUI9SingletonINS_11DataManagerEEC2Ev[_ZN5MyGUI9SingletonINS_11DataManagerEEC5Ev]+0x11): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::msInstance'
MyGUI_OgreDataManager.cpp:(.text._ZN5MyGUI9SingletonINS_11DataManagerEEC2Ev[_ZN5MyGUI9SingletonINS_11DataManagerEEC5Ev]+0x3b): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.o): In function `MyGUI::OgreRenderManager::getInstancePtr()':
MyGUI_OgreRenderManager.cpp:(.text+0x453): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::msInstance'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.o): In function `MyGUI::OgreRenderManager::renderQueueStarted(unsigned char, std::string const&, bool&)':
MyGUI_OgreRenderManager.cpp:(.text+0x813): undefined reference to `MyGUI::Singleton<MyGUI::Gui>::msInstance'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.o): In function `MyGUI::OgreRenderManager::initialise(Ogre::RenderWindow*, Ogre::SceneManager*)':
MyGUI_OgreRenderManager.cpp:(.text+0xa1e): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.o): In function `MyGUI::OgreRenderManager::shutdown()':
MyGUI_OgreRenderManager.cpp:(.text+0x13ce): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.o): In function `MyGUI::OgreRenderManager::createTexture(std::string const&)':
MyGUI_OgreRenderManager.cpp:(.text+0x1e4f): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::msInstance'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.o): In function `MyGUI::Singleton<MyGUI::RenderManager>::~Singleton()':
MyGUI_OgreRenderManager.cpp:(.text._ZN5MyGUI9SingletonINS_13RenderManagerEED2Ev[_ZN5MyGUI9SingletonINS_13RenderManagerEED5Ev]+0x11): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::msInstance'
MyGUI_OgreRenderManager.cpp:(.text._ZN5MyGUI9SingletonINS_13RenderManagerEED2Ev[_ZN5MyGUI9SingletonINS_13RenderManagerEED5Ev]+0x3f): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreRenderManager.cpp.o): In function `MyGUI::Singleton<MyGUI::RenderManager>::Singleton()':
MyGUI_OgreRenderManager.cpp:(.text._ZN5MyGUI9SingletonINS_13RenderManagerEEC2Ev[_ZN5MyGUI9SingletonINS_13RenderManagerEEC5Ev]+0x11): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::msInstance'
MyGUI_OgreRenderManager.cpp:(.text._ZN5MyGUI9SingletonINS_13RenderManagerEEC2Ev[_ZN5MyGUI9SingletonINS_13RenderManagerEEC5Ev]+0x3b): undefined reference to `MyGUI::Singleton<MyGUI::RenderManager>::mClassTypeName'
../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreTexture.cpp.o): In function `MyGUI::Singleton<MyGUI::DataManager>::getInstance()':
MyGUI_OgreTexture.cpp:(.text._ZN5MyGUI9SingletonINS_11DataManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_11DataManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::msInstance'
MyGUI_OgreTexture.cpp:(.text._ZN5MyGUI9SingletonINS_11DataManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_11DataManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::DataManager>::mClassTypeName'
../../lib/libCommon.a(PointerManager.cpp.o): In function `MyGUI::Singleton<MyGUI::PointerManager>::getInstance()':
PointerManager.cpp:(.text._ZN5MyGUI9SingletonINS_14PointerManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_14PointerManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::PointerManager>::msInstance'
PointerManager.cpp:(.text._ZN5MyGUI9SingletonINS_14PointerManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_14PointerManagerEE11getInstanceEv]+0x2a): undefined reference to `MyGUI::Singleton<MyGUI::PointerManager>::mClassTypeName'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/Demo_Colour] Błąd 1
make[1]: *** [Demos/Demo_Colour/CMakeFiles/Demo_Colour.dir/all] Błąd 2
make: *** [all] Błąd 2

Boost (when linking OpenMW):

Linking CXX executable ../../openmw
`.text._ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED2Ev' referenced in section `.text._ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED1Ev[_ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED1Ev]' of /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o): defined in discarded section `.text._ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED2Ev[_ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED5Ev]' of /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o)
`.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED2Ev' referenced in section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED1Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED1Ev]' of /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o): defined in discarded section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED2Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED5Ev]' of /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o)
`.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED2Ev' referenced in section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED1Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED1Ev]' of /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o): defined in discarded section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED2Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED5Ev]' of /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libMyGUI.OgrePlatform.a(MyGUI_OgreDataManager.cpp.o)
CMakeFiles/openmw.dir/mwrender/terrain.cpp.o: In function `Ogre::Singleton<Ogre::TerrainGlobalOptions>::~Singleton()':
terrain.cpp:(.text._ZN4Ogre9SingletonINS_20TerrainGlobalOptionsEED2Ev[_ZN4Ogre9SingletonINS_20TerrainGlobalOptionsEED5Ev]+0xf): undefined reference to `Ogre::Singleton<Ogre::TerrainGlobalOptions>::msSingleton'
terrain.cpp:(.text._ZN4Ogre9SingletonINS_20TerrainGlobalOptionsEED2Ev[_ZN4Ogre9SingletonINS_20TerrainGlobalOptionsEED5Ev]+0x34): undefined reference to `Ogre::Singleton<Ogre::TerrainGlobalOptions>::msSingleton'
collect2: error: ld returned 1 exit status
make[2]: *** [openmw] Błąd 1
make[1]: *** [apps/openmw/CMakeFiles/openmw.dir/all] Błąd 2
make: *** [all] Błąd 2

I think there is something broken at linking stage (linker scripts or something)?

Is there any other way to fix this?

Offline

#7 2012-04-10 23:52:33

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: updating GCC to 4.7 breaks boost 1.49

Allan, these are the same issues I reported initially. How can we fix this?

Offline

#8 2012-04-11 01:24:23

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,408
Website

Re: updating GCC to 4.7 breaks boost 1.49

The errors are different....

These errors in MyGUI:

ColourPanel.cpp:(.text._ZN5MyGUI9SingletonINS_13LayoutManagerEE11getInstanceEv[_ZN5MyGUI9SingletonINS_13LayoutManagerEE11getInstanceEv]+0x3): undefined reference to `MyGUI::Singleton<MyGUI::LayoutManager>::msInstance'

are purely MyGUI linking issues.   They need to be fixed there.

The errors seen when building OpenMW will be likely fixed when MyGUI gets rebuilt... (as they are in libMyGUI.OgrePlatform.a).


The original errors in this thread involving libboost.a should be all fixed.

Offline

#9 2012-04-14 17:11:58

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: updating GCC to 4.7 breaks boost 1.49

I fixed this crap with a hack. See release -2.

Offline

Board footer

Powered by FluxBB