[SOLVED] Linking CXX executable openmw undefined reference.

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
User avatar
AndrzejL
Posts: 23
Joined: 27 Mar 2012, 20:53
Location: PL / IE
Contact:

[SOLVED] Linking CXX executable openmw undefined reference.

Post by AndrzejL »

Final update:

SOLUTION: Clean Your Ogre libraries:

If You get this error it means Your ogre install is messed up and you have leftovers like I did...

http://pastebin.com/raED5vU8

Clean them to succeed in building OpenMW


http://pastebin.com/5Ps6sZFT

Regards.

Andrzej

Hi folks.

Since last night OpenMW needs Ogre 1.8.0 right? Right... I removed old 1.7.2 version using Synaptic (PCLinuxOS 2012.02 - rpm based distro). I removed the ogre, libogre, libogre-devel to be exact and...

I have build bullet http://pastebin.com/kKc7siRk [ALL FINE]
I have build Ogre 1.8.0 http://pastebin.com/LKvVZQmM [ALL FINE]
and My-Gui which detected the right Ogre version http://pastebin.com/uRYPv1mF [ALL FINE]

but building the game fails... http://pastebin.com/9fxiWzKj with error:
[ 89%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/main.cpp.o
[ 90%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/engine.cpp.o
Linking CXX executable ../../openmw
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre12DynamicLinesE[vtable for BtOgre::DynamicLines]+0x150): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getMaterial() const'
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre12DynamicLinesE[vtable for BtOgre::DynamicLines]+0x158): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getRenderOperation(Ogre::RenderOperation&)'
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre12DynamicLinesE[vtable for BtOgre::DynamicLines]+0x164): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getWorldTransforms(Ogre::Matrix4*) const'
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre12DynamicLinesE[vtable for BtOgre::DynamicLines]+0x170): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getLights() const'
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre17DynamicRenderableE[vtable for BtOgre::DynamicRenderable]+0x150): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getMaterial() const'
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre17DynamicRenderableE[vtable for BtOgre::DynamicRenderable]+0x158): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getRenderOperation(Ogre::RenderOperation&)'
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre17DynamicRenderableE[vtable for BtOgre::DynamicRenderable]+0x164): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getWorldTransforms(Ogre::Matrix4*) const'
CMakeFiles/openmw.dir/__/__/libs/openengine/bullet/BtOgre.cpp.o:(.rodata._ZTVN6BtOgre17DynamicRenderableE[vtable for BtOgre::DynamicRenderable]+0x170): undefined reference to `non-virtual thunk to Ogre::SimpleRenderable::getLights() const'
CMakeFiles/openmw.dir/__/__/components/bsa/bsa_archive.cpp.o:(.rodata+0x560): undefined reference to `Ogre::FileSystemArchive::findFileInfo(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) const'
collect2: ld returned 1 exit status
make[2]: *** [openmw] Error 1
make[1]: *** [apps/openmw/CMakeFiles/openmw.dir/all] Error 2
make: *** [all] Error 2
[andrzejl@icsserver build]$
I tried everything I could think off I even tried the things that I could not think off and I asked for help on #openmw channel but even with the best intentions - nothing, nada, zip, zero, big bobkas... I went to bed in the "FAIL" mood... I hate that... But this morning I woke up with an idea... I popped into the #ogre3d channel on freenode and I was told:
07:45 < BronzeBeard> AndrzejL, your problems look like it's with btogre
07:45 < BronzeBeard> did you compile bulletogre with 1.8?
07:46 < AndrzejL> Oh - no i didn't I compiled the bullet / ogre / mygui
07:46 < BronzeBeard> bulletogre needs to be compiled or fix or something :)
07:46 < AndrzejL> is there a bulletogre that I need to download and compile?
07:46 < BronzeBeard> it's a wrapper lib for ogre and bullet
07:46 < BronzeBeard> hummmm
07:46 < BronzeBeard> !ogrewiki bulletogre
07:46 < Veda> BronzeBeard: http://www.ogre3d.org/tikiwiki/OgreBull ... =Libraries
So I have build BulletOgre which was slightly tricky ;) as I was getting
fatal error: ConvexBuilder.h: No such file or directory
after a little digging I have found the file:
[root@icsserver ogrebullet]# updatedb
[root@icsserver ogrebullet]# locate ConvexBuilder.h
and the fix was easy:
[root@icsserver ogrebullet]# cd /opt/OpenMW_Deps/bullet-2.80-rev2531/Extras/
[root@icsserver Extras]# cp ./ConvexDecomposition/*.h /usr/include/bullet/
So after a while - a success - ogrebullet was compiled http://pastebin.com/6bDkJbP9 [ALL FINE]

But the error while making game was still there...

So I re-compiled ogre... http://pastebin.com/zCDwRN5K [ALL FINE]

You will notice that they were few new files installed... BUT game still fails to build with the same error...

Tell me Gandalf... What I must do now...

Regards and thanks in advance...

Andrzej
Last edited by AndrzejL on 01 Apr 2012, 03:00, edited 5 times in total.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: 90% Linking CXX executable openmw undefined reference er

Post by Zini »

I have not seen this problem before, so all I can do is guessing. Are you sure you are not mixing up old and new code somewhere? Did you try to force a complete rebuild of OpenMW?
User avatar
AndrzejL
Posts: 23
Joined: 27 Mar 2012, 20:53
Location: PL / IE
Contact:

Re: 90% Linking CXX executable openmw undefined reference er

Post by AndrzejL »

Zini wrote:I have not seen this problem before, so all I can do is guessing. Are you sure you are not mixing up old and new code somewhere? Did you try to force a complete rebuild of OpenMW?
Hi Zini.

Yes. I removed ~/OpenMW folder completely and re-cloned it from the master git. After that I have cmaked it and tried to make it... Still no go.

Regards.

Andrzej
User avatar
AndrzejL
Posts: 23
Joined: 27 Mar 2012, 20:53
Location: PL / IE
Contact:

Re: 90% Linking CXX executable openmw undefined reference er

Post by AndrzejL »

Guys in #openmw are suggesting that I downgrade bullet to the .77 release and maybe compile boost rather then use the repository version... Also there was a suggestion that I might have some ogre 2.7.x leftovers... I don't think so but I don't really know how to check... This seems like this might be a problem as previous git master version worked fine with this bullet and boost. All that changed is the dang ogre... I think

Here is a list of all OGRE files in /usr/ folder http://pastebin.com/FAhqV6p9

Also here is the output of find /usr | grep "OGRE" http://pastebin.com/18c15MGi

Command find /usr | grep "OGRE-1.7" returns no entries.

Regards.

Andrzej
Last edited by AndrzejL on 29 Mar 2012, 13:47, edited 1 time in total.
User avatar
AndrzejL
Posts: 23
Joined: 27 Mar 2012, 20:53
Location: PL / IE
Contact:

Re: 90% Linking CXX executable openmw undefined reference er

Post by AndrzejL »

Found a solved topic on the Ogre Add-ons forums

http://www.ogre3d.org/addonforums/viewt ... 095#p10084

The solution was to:
All these errors will go away if you define STLP_DEBUG (IIRC) - the errors are stl related. :wink:
but I have NO idea what to do with it...

Regards.

Andrzej
Last edited by AndrzejL on 29 Mar 2012, 13:48, edited 1 time in total.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: 90% Linking CXX executable openmw undefined reference er

Post by Zini »

Sounds like something from the STLPort. Why would you use that on Linux?
User avatar
AndrzejL
Posts: 23
Joined: 27 Mar 2012, 20:53
Location: PL / IE
Contact:

Re: 90% Linking CXX executable openmw undefined reference er

Post by AndrzejL »

Zini wrote:Sounds like something from the STLPort. Why would you use that on Linux?
Thanks for Your reply Zini...

What's STLPort?
[andrzejl@icsserver ~]$ rpm -qa | grep stl
[andrzejl@icsserver ~]$
There are no STL packages installed on my system if this is what You are asking about...

Regards.

Andrzej
User avatar
AndrzejL
Posts: 23
Joined: 27 Mar 2012, 20:53
Location: PL / IE
Contact:

Re: 90% Linking CXX executable openmw undefined reference er

Post by AndrzejL »

12:20 < K1ll> AndrzejL: got it. You need to add it via -DCMAKE_CXX_FLAGS="-DSTLP_DEBUG"
For a moment there was a hope...

But make throws the same error after:
cmake ../openmw -DCMAKE_CXX_FLAGS="-DSTLP_DEBUG"
was used...

Regards.

Andrzej
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: 90% Linking CXX executable openmw undefined reference er

Post by Zini »

STL is the standard template library. A part of every C++ compiler system. STLPort is a replacement implementation, that is sometimes used on systems with low quality STL implementations. You are probably not using it at all.
User avatar
AndrzejL
Posts: 23
Joined: 27 Mar 2012, 20:53
Location: PL / IE
Contact:

Re: 90% Linking CXX executable openmw undefined reference er

Post by AndrzejL »

Zini wrote:STL is the standard template library. A part of every C++ compiler system. STLPort is a replacement implementation, that is sometimes used on systems with low quality STL implementations. You are probably not using it at all.
I have never installed it as far as I remember. Neither I remember ever using it. Would it show up when I listed all installed RPMs?

There is no STLPort in PCLinuxOS repositories from what I can see.

Why oh why would those errors haunt me then ;)?

Thank for Your reply Dude.

Andrzej
Locked