Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
Hi Mike, On 27/06/12 3:28 , Mike Hatcher wrote: > There are two different stages of compilation: 1: A rendering library of > individual > .cpp files is compiled into .o files and ultimately archived into a > libSimRender.a file > using the ar command to build an archive of the .o files. This one is the > one that > includes DOFTransform. > > 2: Then later a visuals subsystem is compiled with it's respective .o files. > Then > these are all linked together with the .a (-lSimRenderer in my above posting) > and then > built into a .so share object using the above compilation/linking command. > > I've run strings against the .a file and the symbols are in there but > probably not > their definition, just the reference. Why I'm not understanding is why the > linking > command for the Visuals.so shared library above are ignore many of the -losg* > objects > I've instructed it to link against. What you could try is to place the '-losgSim' after the '-lSimRenderer' part. I've had cases where the link would be ignored when it wasn't actually used by any of the linked .o files. Cheers, /uli ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
Hi, I've found the problem but it's unclear why it isn't working. The build system in this application does the following: There are two different stages of compilation: 1: A rendering library of individual .cpp files is compiled into .o files and ultimately archived into a libSimRender.a file using the ar command to build an archive of the .o files. This one is the one that includes DOFTransform. 2: Then later a visuals subsystem is compiled with it's respective .o files. Then these are all linked together with the .a (-lSimRenderer in my above posting) and then built into a .so share object using the above compilation/linking command. I've run strings against the .a file and the symbols are in there but probably not their definition, just the reference. Why I'm not understanding is why the linking command for the Visuals.so shared library above are ignore many of the -losg* objects I've instructed it to link against. Under Ubuntu and only under Ubuntu his is happening: Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48540#48540 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
Hi Mike, As a point of reference I'm using Kubuntu 12.04 for my main development machine and haven't had a problems with compiling the OSG or 3rd party applications that depend upon it. These days I don't directly use Makefiles, rather I create a CMake CMakeLists.txt and let cmake create the Makefile for me. I've copied and pasted below what a a simple CMakeLists.txt file would be for compiling a simple application that uses core OSG and couple of NodeKits. Hope this helps, Robert. -- cmake_minimum_required(VERSION 2.6) PROJECT(myapp) FIND_PACKAGE(OpenThreads) FIND_PACKAGE(osg) FIND_PACKAGE(osgDB) FIND_PACKAGE(osgViewer) FIND_PACKAGE(osgShadow) FIND_PACKAGE(osgSim) FIND_PACKAGE(osgParticle) SET(SOURCES main.cpp ) INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR} ${OSG_INCLUDE_DIR}) LINK_DIRECTORIES(${OSG_LIB_DIR}) ADD_EXECUTABLE(myapp ${SOURCES}) TARGET_LINK_LIBRARIES(myapp ${OSG_LIBRARY} ${OSGVIEWER_LIBRARY} ${OSGSIM_LIBRARY} ${OSGPARTICLE_LIBRARY} ${OSGSHADOW_LIBRARY} ${OPENTHREADS_LIBRARY}) ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
Hi, Thanks for the response Alberto. Just to be sure, I took a clean stock VM, installed 32-bit Ubuntu server (don't need a full blown desktop) added the X server and all the thirdparty tools, installed openthreads, openscenegraph, etc... (and their corresponding development packages). I've run updatedb to ensure I have the latest file system index and I can now guarantee you that there is only one openscene graph installed on both the 64-bit OS I was originally using when I first posted as well as the 32-bit OS I just stood up. Both in VMware. I'm convinced now even more so that there is something very strange going on with Ubuntu and it's build system. On the 32-bit OS I setup just for this issue, I get the exact same error message. Thank you for the reminder about ldd. I knew about that! At least at one time anyway. I checked and sure enough, osgSim is not listed as a dependence even though it was *clearly* specified on the compile line. At least now I have a place to dig. I'll post on the resolution I come up with. BTW I've also tried building clean from source. In that instance I get a different error about an unresolved symbol from osgUtil. I think there is something broken with builds under Ubuntu 12.04 although I can't quite put my finger on it yet. Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48534#48534 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
"Mike Hatcher" writes: > Hi, > > I'm having the same problem. I'm also running Ubuntu 12.04. I know the code > works because I have it running under Fedora 13. > > The critical line is: > g++ -g -gstabs+ -DOSG_COMPILE_UNIT_TESTS -L/usr/X11R6/lib64 > -L../../../../local/lib -L../../../../devel/lib/Linux64 -shared DAHud.o > DynamicManager.o EnvironmentManager.o HudManager.o StaticManager.o > TileGroup.o VectionViewMode.o vectionVisuals.o vectionVisUtils.o > VehicleCameraPlatform.o ViewModeFirstPerson.o ViewModeThirdPerson.o VisData.o > Visuals.o -losgSim -losgGA -losgViewer -losg -losgUtil -losgDB > -losgParticle -losgText -losgSim -losgFX -lOpenThreads -lsimApp -lSimRenderer > -ljpeg -lxclApp -lboost_signals -o Visuals.so > > The -L in the above example in my case does need to be there because it is > also linking against Producer. Because it is a shared library everything > compiles just fine. It's when it runs that I have a problem. I wind up with: > > undefined symbol: _ZN6osgSim12DOFTransform8traverseERN3osg11NodeVisitorE > > I've tried adding every osg* lib I can think of but it makes no difference. > Any ideas would be much appreciated! > Hi Mike, I think you are mixing several OSG versions, that is why the symbol is not found at runtime: $ c++filt _ZN6osgSim12DOFTransform8traverseERN3osg11NodeVisitorE osgSim::DOFTransform::traverse(osg::NodeVisitor&) Make sure you are not compiling usign headers from one version of OSG and linking to other different version. I suggest to use 'ldd' for checking that. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
Hi, I'm having the same problem. I'm also running Ubuntu 12.04. I know the code works because I have it running under Fedora 13. The critical line is: g++ -g -gstabs+ -DOSG_COMPILE_UNIT_TESTS -L/usr/X11R6/lib64 -L../../../../local/lib -L../../../../devel/lib/Linux64 -shared DAHud.o DynamicManager.o EnvironmentManager.o HudManager.o StaticManager.o TileGroup.o VectionViewMode.o vectionVisuals.o vectionVisUtils.o VehicleCameraPlatform.o ViewModeFirstPerson.o ViewModeThirdPerson.o VisData.o Visuals.o -losgSim -losgGA -losgViewer -losg -losgUtil -losgDB -losgParticle -losgText -losgSim -losgFX -lOpenThreads -lsimApp -lSimRenderer -ljpeg -lxclApp -lboost_signals -o Visuals.so The -L in the above example in my case does need to be there because it is also linking against Producer. Because it is a shared library everything compiles just fine. It's when it runs that I have a problem. I wind up with: undefined symbol: _ZN6osgSim12DOFTransform8traverseERN3osg11NodeVisitorE I've tried adding every osg* lib I can think of but it makes no difference. Any ideas would be much appreciated! Thank you! Cheers, Mike -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48505#48505 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
Hi Vijay, Vijay Patil writes: > Hello, > > As mentioned in thread: > http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2012-January/055703.html > > I too installed 'libopenscenegraph-dev' package on Ubuntu 12.04 and struggled > with compile time linking errors for simple application 'osglogo.cpp' etc. > > As Alberto pointed correctly following works perfectly fine: > > $ g++ osglogo.cpp -lOpenThreads -losg -losgDB -losgUtil -losgGA -losgText > -losgViewer -o osglogo.exe > > OSG headers are installed in /usr/include and libraries are in /usr/lib, > which are known to compiler and linker so no need to explicitly use -I or -L > flags. > > Specifically one has to be careful about the order of your application > objects and osg shared libraries, to make linker happy. Thanks for publishing your achievements. It will help others in the future. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Compiling OSG applications on Ubuntu 12.04 = OK
Hello, As mentioned in thread: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2012-January/055703.html I too installed 'libopenscenegraph-dev' package on Ubuntu 12.04 and struggled with compile time linking errors for simple application 'osglogo.cpp' etc. As Alberto pointed correctly following works perfectly fine: $ g++ osglogo.cpp -lOpenThreads -losg -losgDB -losgUtil -losgGA -losgText -losgViewer -o osglogo.exe OSG headers are installed in /usr/include and libraries are in /usr/lib, which are known to compiler and linker so no need to explicitly use -I or -L flags. Specifically one has to be careful about the order of your application objects and osg shared libraries, to make linker happy. -- Vijay Patil ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org