查看: 1511|回复: 0

osgEarth在OSX 10.10上的编译问题

[复制链接]

该用户从未签到

发表于 2015-1-18 12:33:14 | 显示全部楼层 |阅读模式
各位好~
我尝试在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

错误仍然存在。

想请教各位,有否遇到过类似问题,如何解决?

谢谢

您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表