Board index FlightGear Support Compiling

[SOLVED] undefined reference to symbol 'OpenThreads::

Building FlightGear from source, and in the need for help?

[SOLVED] undefined reference to symbol 'OpenThreads::

Postby kuifje09 » Fri Jun 21, 2013 2:14 pm

Hi, I try to compile flightgear using download_and_install.sh, and I thought it was working, but now I try and get this error :
Linking CXX executable fgfs
/usr/bin/ld: CMakeFiles/fgfs.dir/__/Sound/voice.cxx.o: undefined reference to symbol 'OpenThreads::Thread::setProcessorAffinity(unsigned int)'
/usr/bin/ld: note: 'OpenThreads::Thread::setProcessorAffinity(unsigned int)' is defined in DSO /home/flight/FG/install/OpenSceneGraph/lib/libOpenThreads.so.12 so try adding it to the linker command line
/home/flight/FG/install/OpenSceneGraph/lib/libOpenThreads.so.12: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [src/Main/fgfs] Error 1
make[1]: *** [src/Main/CMakeFiles/fgfs.dir/all] Error 2

How can that be, and how to resolve...

I must say, I did a copy of the plib osg and simgear to /usr/local/... But now it searches in the local-flightgear-develop tree and in /usr/local/...
The copy was needed because it kept complaining not finding several libs. ( I would love, download_and_compile had also an install option...)
Last edited by kuifje09 on Sat Jun 22, 2013 2:58 pm, edited 1 time in total.
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: undefined reference to symbol 'OpenThreads::Thread::setP

Postby kuifje09 » Fri Jun 21, 2013 7:33 pm

When I skip the Sound-module: I get the next error :
Linking CXX executable fgfs
/usr/bin/ld: CMakeFiles/fgfs.dir/__/Viewer/renderer.cxx.o: undefined reference to symbol 'OpenThreads::Atomic::operator unsigned int() const'
/usr/bin/ld: note: 'OpenThreads::Atomic::operator unsigned int() const' is defined in DSO /home/flight/FG/install/OpenSceneGraph/lib/libOpenThreads.so.12 so try adding it to the linker command line
/home/flight/FG/install/OpenSceneGraph/lib/libOpenThreads.so.12: could not read symbols: Invalid operation
collect2: ld returned 1 exit status


What I don't get, it can be compiled but cannot be linked ???
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: undefined reference to symbol 'OpenThreads::Thread::setP

Postby Hooray » Fri Jun 21, 2013 7:57 pm

kuifje09 wrote in Fri Jun 21, 2013 2:14 pm:I must say, I did a copy of the plib osg and simgear to /usr/local/... But now it searches in the local-flightgear-develop tree and in /usr/local/...
The copy was needed because it kept complaining not finding several libs. ( I would love, download_and_compile had also an install option...)


You cannot just do that or it will cause the errors you are seeing, you need to let the d&c script use its CMAKE_INSTALL_PREFIX magic so that all libs are found correctly, note that this does not require system-wide installation. Installing in $HOME will do. Before you progress any further, make sure to remove all the manually copied stuff or it will cause really ugly installation errors. Just delete everything that you have copied there, and only install LOCALLY, not system-wide.

For details, see the d&c wiki article.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: undefined reference to symbol 'OpenThreads::Thread::setP

Postby kuifje09 » Fri Jun 21, 2013 8:08 pm

Hello Hooray, I did not overwrite my original systemfiles. But just a few fileset I had from a previous instalation created with download_and_compile.sh
They where from a few years back. I would not dare to overwrite systemfiles ( ubuntu - installed ) because it could rendeer my system useless.
It is an ugly error, I can compile but cannot link, and all related to the osg/Openthread files so it seems.
These Build/Install files :
flight@Dell:~/FG$ locate libOpenThreads.so.12
/home/flight/FG/build/osg/lib/libOpenThreads.so.12
/home/flight/FG/install/OpenSceneGraph/lib/libOpenThreads.so.12

I have no other like these on my system. The other is /usr/lib/libOpenThreads.so.14 but very strange also linked to libOpenThreads.so.2.6.0
How can a different extention .12 and .14 be linked to the same libOpenThreads.so.2.6.0. I would expect at least a minor version difference.


EDIT : it is absolute a colission with my previous "private" installs. I have to clean it up. made a quick-and-dirty fix, but have to find how to solve it more secure. I can compile and link wow.... :P
Last edited by kuifje09 on Fri Jun 21, 2013 8:25 pm, edited 1 time in total.
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm

Re: undefined reference to symbol 'OpenThreads::Thread::setP

Postby Hooray » Fri Jun 21, 2013 8:18 pm

see my previous response, you should really be using the traditional install_prefix method without tampering with headers/libs, and without manually copying stuff around, the d&c script only requires root permissions once, for pulling in all required tools - but afterwards, you can keep things in $HOME.

Really, you are making this more difficult than it needs to be if you don't revert your changes immediately and start over in a clean directory.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11309
Joined: Tue Mar 25, 2008 8:40 am

Re: undefined reference to symbol 'OpenThreads::Thread::setP

Postby kuifje09 » Fri Jun 21, 2013 8:29 pm

Hi , we just missed eachothers message...
Its is not about the develop tree of flightgear, but it is a colission in search path. The devellop-tree is clean! but some files also resides outside the tree with the same name. Thats the point. I was not triggered immediatly to see the problem, but those things arise when one package does this and the other want it in another way. But I can fix it, no problem.

Edit : Fix : Removed libOpenThreads.so from /usr/local/lib and ran ldconfig.
kuifje09
 
Posts: 579
Joined: Tue May 17, 2011 8:51 pm


Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest