Re: [osg-users] Compiling OSG applications on Linux
Hi, I'm interested in using OSG for a project but am having difficulty compiling the example applications. I am running Ubuntu linux and installed the binaries through the package manager and also built the source. I am able to run the osgversion command as the OSG Quick Start Guide instructs but cannot compile an example program. For example, to compile the sample osglogo program, I try running the command: Code: g++ -I/usr/local/include/ -L/usr/local/lib/ -losgViewer -losgDB -losgUtil -losg osglogo.cpp Which is what the Quick Start Guide says to do. I do indeed have the osg header files in the /usr/local/include/osg* directories and library files in /usr/local/lib/libosg*. I also appended /usr/local/lib to my /etc/ld.so.conf file and ran ldconfig, but I am still receiving this lengthy compiler message: Code: /tmp/ccQ8pJfi.o: In function `createWing(osg::Vec3f const, osg::Vec3f const, osg::Vec3f const, float, osg::Vec4f const)': osglogo.cpp:(.text+0x1d): undefined reference to `osg::Geometry::Geometry()' osglogo.cpp:(.text+0x2cb): undefined reference to `osg::Geometry::setVertexArray(osg::Array*)' osglogo.cpp:(.text+0x30e): undefined reference to `osg::Geometry::setNormalArray(osg::Array*)' osglogo.cpp:(.text+0x321): undefined reference to `osg::Geometry::setNormalBinding(osg::Geometry::AttributeBinding)' osglogo.cpp:(.text+0x361): undefined reference to `osg::Geometry::setColorArray(osg::Array*)' osglogo.cpp:(.text+0x374): undefined reference to `osg::Geometry::setColorBinding(osg::Geometry::AttributeBinding)' osglogo.cpp:(.text+0x3c9): undefined reference to `osg::Geometry::addPrimitiveSet(osg::PrimitiveSet*)' osglogo.cpp:(.text+0x3d7): undefined reference to `osgUtil::Tessellator::Tessellator()' osglogo.cpp:(.text+0x3ec): undefined reference to `osgUtil::Tessellator::retessellatePolygons(osg::Geometry)' osglogo.cpp:(.text+0x3fd): undefined reference to `osgUtil::Tessellator::~Tessellator()' osglogo.cpp:(.text+0x47a): undefined reference to `osgUtil::Tessellator::~Tessellator()' /tmp/ccQ8pJfi.o: In function `createTextBelow(osg::BoundingBoxImplosg::Vec3f const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': osglogo.cpp:(.text+0x4a2): undefined reference to `osg::Geode::Geode()' osglogo.cpp:(.text+0x4eb): undefined reference to `osgText::Text::Text()' osglogo.cpp:(.text+0x524): undefined reference to `osgText::TextBase::setFontResolution(unsigned int, unsigned int)' osglogo.cpp:(.text+0x537): undefined reference to `osgText::TextBase::setAlignment(osgText::TextBase::AlignmentType)' osglogo.cpp:(.text+0x54a): undefined reference to `osgText::TextBase::setAxisAlignment(osgText::TextBase::AxisAlignment)' osglogo.cpp:(.text+0x5ca): undefined reference to `osgText::TextBase::setPosition(osg::Vec3f const)' osglogo.cpp:(.text+0x60b): undefined reference to `osgText::TextBase::setColor(osg::Vec4f const)' osglogo.cpp:(.text+0x61d): undefined reference to `osgText::TextBase::setText(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)' /tmp/ccQ8pJfi.o: In function `createTextLeft(osg::BoundingBoxImplosg::Vec3f const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': osglogo.cpp:(.text+0x6be): undefined reference to `osg::Geode::Geode()' osglogo.cpp:(.text+0x6cc): undefined reference to `osg::Node::getOrCreateStateSet()' osglogo.cpp:(.text+0x6ea): undefined reference to `osg::StateSet::setMode(unsigned int, unsigned int)' osglogo.cpp:(.text+0x730): undefined reference to `osgText::Text::Text()' osglogo.cpp:(.text+0x769): undefined reference to `osgText::TextBase::setFontResolution(unsigned int, unsigned int)' osglogo.cpp:(.text+0x77c): undefined reference to `osgText::TextBase::setAlignment(osgText::TextBase::AlignmentType)' osglogo.cpp:(.text+0x78f): undefined reference to `osgText::TextBase::setAxisAlignment(osgText::TextBase::AxisAlignment)' osglogo.cpp:(.text+0x7c0): undefined reference to `osgText::TextBase::setCharacterSize(float)' osglogo.cpp:(.text+0x8aa): undefined reference to `osgText::TextBase::setPosition(osg::Vec3f const)' osglogo.cpp:(.text+0x8f1): undefined reference to `osgText::TextBase::setColor(osg::Vec4f const)' osglogo.cpp:(.text+0x903): undefined reference to `osgText::TextBase::setText(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)' osglogo.cpp:(.text+0x916): undefined reference to `osgText::Text::setBackdropType(osgText::Text::BackdropType)' osglogo.cpp:(.text+0x929): undefined reference to `osgText::Text::setBackdropImplementation(osgText::Text::BackdropImplementation)' osglogo.cpp:(.text+0x93d): undefined reference to `osgText::Text::setBackdropOffset(float)' osglogo.cpp:(.text+0x984): undefined reference to `osgText::Text::setBackdropColor(osg::Vec4f const)' osglogo.cpp:(.text+0x997): undefined
Re: [osg-users] Compiling OSG applications on Linux
On 1/5/2012 9:07 AM, Amar Dinsa wrote: I'm interested in using OSG for a project but am having difficulty compiling the example applications. I am running Ubuntu linux and installed the binaries through the package manager and also built the source. I am able to run the osgversion command as the OSG Quick Start Guide instructs but cannot compile an example program. You migh want to consider downloading my pre-compiled binaries of OSG, unless you feel like you might be changing the core OSG source itself. http://openscenegraph.alphapixel.com/osg/downloads/free-openscenegraph-binary-downloads -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ 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 Linux
Hi, I'm interested in using OSG for a project but am having difficulty compiling the example applications. I am running Ubuntu linux and installed the binaries through the package manager and also built the source. I am able to run the osgversion command as the OSG Quick Start Guide instructs but cannot compile an example program. For example, to compile the sample osglogo program, I try running the command: Code: g++ -I/usr/local/include/ -L/usr/local/lib/ -losgViewer -losgDB -losgUtil -losg osglogo.cpp Which is what the Quick Start Guide says to do. I do indeed have the osg header files in the /usr/local/include/osg* directories and library files in /usr/local/lib/libosg*. I also appended /usr/local/lib to my /etc/ld.so.conf file and ran ldconfig, but I am still receiving this lengthy compiler message: Code: /tmp/ccQ8pJfi.o: In function `createWing(osg::Vec3f const, osg::Vec3f const, osg::Vec3f const, float, osg::Vec4f const)': osglogo.cpp:(.text+0x1d): undefined reference to `osg::Geometry::Geometry()' osglogo.cpp:(.text+0x2cb): undefined reference to `osg::Geometry::setVertexArray(osg::Array*)' osglogo.cpp:(.text+0x30e): undefined reference to `osg::Geometry::setNormalArray(osg::Array*)' osglogo.cpp:(.text+0x321): undefined reference to `osg::Geometry::setNormalBinding(osg::Geometry::AttributeBinding)' osglogo.cpp:(.text+0x361): undefined reference to `osg::Geometry::setColorArray(osg::Array*)' osglogo.cpp:(.text+0x374): undefined reference to `osg::Geometry::setColorBinding(osg::Geometry::AttributeBinding)' osglogo.cpp:(.text+0x3c9): undefined reference to `osg::Geometry::addPrimitiveSet(osg::PrimitiveSet*)' osglogo.cpp:(.text+0x3d7): undefined reference to `osgUtil::Tessellator::Tessellator()' osglogo.cpp:(.text+0x3ec): undefined reference to `osgUtil::Tessellator::retessellatePolygons(osg::Geometry)' osglogo.cpp:(.text+0x3fd): undefined reference to `osgUtil::Tessellator::~Tessellator()' osglogo.cpp:(.text+0x47a): undefined reference to `osgUtil::Tessellator::~Tessellator()' /tmp/ccQ8pJfi.o: In function `createTextBelow(osg::BoundingBoxImplosg::Vec3f const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': osglogo.cpp:(.text+0x4a2): undefined reference to `osg::Geode::Geode()' osglogo.cpp:(.text+0x4eb): undefined reference to `osgText::Text::Text()' osglogo.cpp:(.text+0x524): undefined reference to `osgText::TextBase::setFontResolution(unsigned int, unsigned int)' osglogo.cpp:(.text+0x537): undefined reference to `osgText::TextBase::setAlignment(osgText::TextBase::AlignmentType)' osglogo.cpp:(.text+0x54a): undefined reference to `osgText::TextBase::setAxisAlignment(osgText::TextBase::AxisAlignment)' osglogo.cpp:(.text+0x5ca): undefined reference to `osgText::TextBase::setPosition(osg::Vec3f const)' osglogo.cpp:(.text+0x60b): undefined reference to `osgText::TextBase::setColor(osg::Vec4f const)' osglogo.cpp:(.text+0x61d): undefined reference to `osgText::TextBase::setText(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)' /tmp/ccQ8pJfi.o: In function `createTextLeft(osg::BoundingBoxImplosg::Vec3f const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const, std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': osglogo.cpp:(.text+0x6be): undefined reference to `osg::Geode::Geode()' osglogo.cpp:(.text+0x6cc): undefined reference to `osg::Node::getOrCreateStateSet()' osglogo.cpp:(.text+0x6ea): undefined reference to `osg::StateSet::setMode(unsigned int, unsigned int)' osglogo.cpp:(.text+0x730): undefined reference to `osgText::Text::Text()' osglogo.cpp:(.text+0x769): undefined reference to `osgText::TextBase::setFontResolution(unsigned int, unsigned int)' osglogo.cpp:(.text+0x77c): undefined reference to `osgText::TextBase::setAlignment(osgText::TextBase::AlignmentType)' osglogo.cpp:(.text+0x78f): undefined reference to `osgText::TextBase::setAxisAlignment(osgText::TextBase::AxisAlignment)' osglogo.cpp:(.text+0x7c0): undefined reference to `osgText::TextBase::setCharacterSize(float)' osglogo.cpp:(.text+0x8aa): undefined reference to `osgText::TextBase::setPosition(osg::Vec3f const)' osglogo.cpp:(.text+0x8f1): undefined reference to `osgText::TextBase::setColor(osg::Vec4f const)' osglogo.cpp:(.text+0x903): undefined reference to `osgText::TextBase::setText(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)' osglogo.cpp:(.text+0x916): undefined reference to `osgText::Text::setBackdropType(osgText::Text::BackdropType)' osglogo.cpp:(.text+0x929): undefined reference to `osgText::Text::setBackdropImplementation(osgText::Text::BackdropImplementation)' osglogo.cpp:(.text+0x93d): undefined reference to `osgText::Text::setBackdropOffset(float)' osglogo.cpp:(.text+0x984): undefined reference to `osgText::Text::setBackdropColor(osg::Vec4f const)' osglogo.cpp:(.text+0x997): undefined
Re: [osg-users] Compiling OSG applications on Linux
Amar Dinsa writes: Hi, I'm interested in using OSG for a project but am having difficulty compiling the example applications. I am running Ubuntu linux and installed the binaries through the package manager and also built the source. I am able to run the osgversion command as the OSG Quick Start Guide instructs but cannot compile an example program. For example, to compile the sample osglogo program, I try running the command: Code: g++ -I/usr/local/include/ -L/usr/local/lib/ -losgViewer -losgDB -losgUtil -losg osglogo.cpp Be careful — if you installed OSG through Ubuntu's package manager, OSG headers are installed in /usr/include, and libraries under /usr/lib. No need to mess with ld.so.conf, nor specify directories at compile time. Since you have those headers in /usr/local, I guess they are left from an older compilation from source. Don't mix them! In your case, you lack some libraries, specially the core one, -losg. Keep adding libraries -losgText,... until the link errors are gone. Which is what the Quick Start Guide says to do. I do indeed have the osg header files in the /usr/local/include/osg* directories and library files in /usr/local/lib/libosg*. I also appended /usr/local/lib to my /etc/ld.so.conf file and ran ldconfig, but I am still receiving this lengthy compiler message: Code: /tmp/ccQ8pJfi.o: In function `createWing(osg::Vec3f const, osg::Vec3f const, osg::Vec3f const, float, osg::Vec4f const)': [...] Regards, -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org