各位好~
我尝试在rmbp上编译osgEarth2.6,OSG是最新版3.2.1,操作系统是最新的OSX10.10,Qt5.2,Cmake 3.1.0,用GNU编译器进行编译。
我先尝试编译了osg,参考网上的资料和自己的尝试,编译成功,在Qt中新创建的工程,用简单的例子,成功看到了肥牛~
在编译osgEarth的时候遇到问题:
Linking CXX shared library ../../lib/libosgEarth.dylib
Undefined symbols for architecture x86_64:
"osg::computeLocalToWorld(std::__1::vector<osg::Node*, std::__1::allocator<osg::Node*> > const&, bool)", referenced from:
osgEarth::CullNodeByEllipsoid:perator()(osg::Node*, osg::NodeVisitor*) in CullingUtils.cpp.o
osgEarth::CullNodeByHorizon::operator()(osg::Node*, osg::NodeVisitor*) in CullingUtils.cpp.o
osgEarth::OverlayNode::traverse(osg::NodeVisitor&) in OverlayNode.cpp.o
.....
"osgDB::ReaderWriter::fileExists(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, osgDB::Options const*) const", referenced from:
vtable for osgEarth::CacheDriver in Cache.cpp.o
vtable for (anonymous namespace)::CompositeTileSourceDriver in CompositeTileSource.cpp.o
vtable for osgEarth::TileSourceDriver in CompositeTileSource.cpp.o
vtable for osgEarthStringReaderWriterJSON in IOTypes.cpp.o
vtable for osgEarthStringReaderWriterXML in IOTypes.cpp.o
vtable for osgEarth::MaskSourceDriver in MaskSource.cpp.o
vtable for osgEarth::ModelSourceDriver in ModelSource.cpp.o
...
"osgDB::ReaderWriter::acceptsProtocol(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
vtable for osgEarth::CacheDriver in Cache.cpp.o
vtable for (anonymous namespace)::CompositeTileSourceDriver in CompositeTileSource.cpp.o
vtable for osgEarth::TileSourceDriver in CompositeTileSource.cpp.o
vtable for osgEarthStringReaderWriterJSON in IOTypes.cpp.o
vtable for osgEarthStringReaderWriterXML in IOTypes.cpp.o
vtable for osgEarth::MaskSourceDriver in MaskSource.cpp.o
vtable for osgEarth::ModelSourceDriver in ModelSource.cpp.o
...
"osgDB::ReaderWriter::acceptsExtension(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
vtable for osgEarth::CacheDriver in Cache.cpp.o
vtable for (anonymous namespace)::CompositeTileSourceDriver in CompositeTileSource.cpp.o
vtable for osgEarth::TileSourceDriver in CompositeTileSource.cpp.o
vtable for osgEarthStringReaderWriterJSON in IOTypes.cpp.o
vtable for osgEarthStringReaderWriterXML in IOTypes.cpp.o
vtable for osgEarth::MaskSourceDriver in MaskSource.cpp.o
vtable for osgEarth::ModelSourceDriver in ModelSource.cpp.o
...
"osgShadow::ConvexPolyhedron::getPoints(std::__1::vector<osg::Vec3d, std::__1::allocator<osg::Vec3d> >&) const", referenced from:
osgEarth::OverlayDecorator::cullTerrainAndCalculateRTTParams(osgUtil::CullVisitor*, osgEarth::OverlayDecorator:erViewData&) in OverlayDecorator.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libosgEarth.2.6.0.dylib] Error 1
make[1]: *** [src/osgEarth/CMakeFiles/osgEarth.dir/all] Error 2
make: *** [all] Error 2
尝试按照stackoverflow上关于编译opencv类似错误修改了链接的-lstdc++,和Qt中qmake.conf里
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
改成 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9 错误仍然存在。 想请教各位,有否遇到过类似问题,如何解决? 谢谢 |