"Daniel Leinad" writes:

> Hi,
>
> i'd like to compile osg (in order to be able to compile flightgear). i am 
> using ubuntu 10.04, have a 4-core-processor, and downloaded the osg-sources 
> by using "svn co .../OpenSceneGraph-2.8.3 OpenSceneGraph". i also installed 
> the osg-build-dependencies by "apt-get build-dep openscenegraph".
> but when i try "configure" followed by "make", i get the following errors in 
> the end:
>
> "
> ...
> [ 99%] Built target osgdb_svg
> Linking CXX executable ../../bin/osgviewer
> /usr/bin/ld: ../../lib/libosgDB.so.2.8.3: error: undefined reference to 
> 'dlerror'
> /usr/bin/ld: ../../lib/libosgDB.so.2.8.3: error: undefined reference to 
> 'dlclose'
> /usr/bin/ld: ../../lib/libosgDB.so.2.8.3: error: undefined reference to 
> 'dlopen'
> /usr/bin/ld: ../../lib/libosg.so.2.8.3: error: undefined reference to 'dlsym'
> collect2: ld returned 1 exit status
> make[2]: *** [bin/osgviewer] Fehler 1
> make[1]: *** 
> [applications/osgviewer/CMakeFiles/application_osgviewer.dir/all] Fehler 2
> make: *** [all] Fehler 2
> "
>
> It seems to have something to do with the library "pthreads", because my "ld" 
> doesn't seem to understand the option "-lpthreads".

Hi Daniel,

this is a known linker issue with newer linux distributions. The
official 2.8.3 package for Ubuntu has taken this into account. If you
really need to build from source, you need this patch:

--- a/OpenSceneGraph/src/osg/CMakeLists.txt
+++ b/OpenSceneGraph/src/osg/CMakeLists.txt
@@ -323,7 +323,7 @@
 LINK_INTERNAL(${LIB_NAME}     
     OpenThreads
 )
-LINK_EXTERNAL(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT}    ${MATH_LIBRARY} )
+LINK_EXTERNAL(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT}    ${MATH_LIBRARY} -ldl )
 LINK_CORELIB_DEFAULT(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} )
 
 INCLUDE(ModuleInstall OPTIONAL)


This is already fixed in SVN.

Regards,

-- 
Alberto

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to