查看: 2275|回复: 2

osgOcean1.0.1编译的问题

[复制链接]

该用户从未签到

发表于 2012-4-30 20:13:37 | 显示全部楼层 |阅读模式
我在用OSG2.8.4和osgOcean1.0.1联合编译     编译成功


但是,由于我的场景里面有骨骼动画,需要用到FBX。我用OSG3.0.1与FBX联合编译成功了。但是,osg3.0.1和OSGOcean联合编译时就出错了。出错信息如下:

1>------ 已启动生成: 项目: osgOcean, 配置: Release Win32 ------
1>正在编译...
1>SiltEffect.cpp
1>正在链接...
1>   正在创建库 ..\..\lib\Release\osgOcean.lib 和对象 ..\..\lib\Release\osgOcean.exp
1>LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
1>OceanScene.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall osg::MatrixTransform::setMatrix(class osg::Matrixf const &)" (__imp_?setMatrix@MatrixTransform@osg@@QAEXABVMatrixf@2@@Z),该符号在函数 "public: virtual void __thiscall `anonymous namespace'::CameraTrackCallback:perator()(class osg::Node *,class osg::NodeVisitor *)" (??RCameraTrackCallback@?A0x6819ffe1@@UAEXPAVNode@osg@@PAVNodeVisitor@3@@Z) 中被引用
1>OceanScene.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::Camera::computeLocalToWorldMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeLocalToWorldMatrix@Camera@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
1>OceanScene.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::Camera::computeWorldToLocalMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeWorldToLocalMatrix@Camera@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
1>OceanScene.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::MatrixTransform::computeLocalToWorldMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeLocalToWorldMatrix@MatrixTransform@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
1>OceanScene.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::MatrixTransform::computeWorldToLocalMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeWorldToLocalMatrix@MatrixTransform@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
1>SiltEffect.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall osgUtil::CullVisitor::updateCalculatedNearFar(class osg::Matrixf const &,class osg::BoundingBoxImpl<class osg::Vec3f> const &)" (__imp_?updateCalculatedNearFar@CullVisitor@osgUtil@@QAE_NABVMatrixf@osg@@ABV?$BoundingBoxImpl@VVec3f@osg@@@4@@Z),该符号在函数 "protected: bool __thiscall osgOcean::SiltEffect::build(class osg::Vec3f,int,int,int,float,struct osgOcean::SiltEffect::SiltDrawableSet &,class osg:olytope &,class osgUtil::CullVisitor *)const " (?build@SiltEffect@osgOcean@@IBE_NVVec3f@osg@@HHHMAAUSiltDrawableSet@12@AAVPolytope@4@PAVCullVisitor@osgUtil@@@Z) 中被引用
1>SiltEffect.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class osg::RefMatrixf * __thiscall osg::CullStack::getModelViewMatrix(void)" (__imp_?getModelViewMatrix@CullStack@osg@@QAEPAVRefMatrixf@2@XZ),该符号在函数 "protected: bool __thiscall osgOcean::SiltEffect::build(class osg::Vec3f,int,int,int,float,struct osgOcean::SiltEffect::SiltDrawableSet &,class osg::Polytope &,class osgUtil::CullVisitor *)const " (?build@SiltEffect@osgOcean@@IBE_NVVec3f@osg@@HHHMAAUSiltDrawableSet@12@AAVPolytope@4@PAVCullVisitor@osgUtil@@@Z) 中被引用
1>SiltEffect.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall osg::Polytope::transformProvidingInverse(class osg::Matrixf const &)" (__imp_?transformProvidingInverse@Polytope@osg@@QAEXABVMatrixf@2@@Z),该符号在函数 "protected: void __thiscall osgOcean::SiltEffect::cull(struct osgOcean::SiltEffect::SiltDrawableSet &,class osgUtil::CullVisitor *)const " (?cull@SiltEffect@osgOcean@@IBEXAAUSiltDrawableSet@12@PAVCullVisitor@osgUtil@@@Z) 中被引用
1>SiltEffect.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class osg::RefMatrixf * __thiscall osg::CullStack::getProjectionMatrix(void)" (__imp_?getProjectionMatrix@CullStack@osg@@QAEPAVRefMatrixf@2@XZ),该符号在函数 "protected: void __thiscall osgOcean::SiltEffect::cull(struct osgOcean::SiltEffect::SiltDrawableSet &,class osgUtil::CullVisitor *)const " (?cull@SiltEffect@osgOcean@@IBEXAAUSiltDrawableSet@12@PAVCullVisitor@osgUtil@@@Z) 中被引用
1>SiltEffect.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall osgUtil::CullVisitor::addDrawableAndDepth(class osg:rawable *,class osg::RefMatrixf *,float)" (__imp_?addDrawableAndDepth@CullVisitor@osgUtil@@QAEXPAVDrawable@osg@@PAVRefMatrixf@4@M@Z),该符号在函数 "public: virtual void __thiscall osgOcean::SiltEffect::traverse(class osg::NodeVisitor &)" (?traverse@SiltEffect@osgOcean@@UAEXAAVNodeVisitor@osg@@@Z) 中被引用
1>..\..\bin\Release\osgOcean.dll : fatal error LNK1120: 10 个无法解析的外部命令
1>生成日志保存在“file://f:\VR\osg\osgocean\osgOcean\src\osgOcean\osgOcean.dir\Release\BuildLog.htm”
1>osgOcean - 11 个错误,1 个警告
2>------ 已启动生成: 项目: oceanExample, 配置: Release Win32 ------
2>正在执行预链接事件...
2>正在链接...
2>application.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::Camera::computeLocalToWorldMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeLocalToWorldMatrix@Camera@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
2>application.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::Camera::computeWorldToLocalMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeWorldToLocalMatrix@Camera@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
2>application.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall osg::MatrixTransform::setMatrix(class osg::Matrixf const &)" (__imp_?setMatrix@MatrixTransform@osg@@QAEXABVMatrixf@2@@Z),该符号在函数 "public: virtual void __thiscall CameraTrackCallback::operator()(class osg::Node *,class osg::NodeVisitor *)" (??RCameraTrackCallback@@UAEXPAVNode@osg@@PAVNodeVisitor@2@@Z) 中被引用
2>application.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::PositionAttitudeTransform::computeLocalToWorldMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeLocalToWorldMatrix@PositionAttitudeTransform@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
2>application.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::PositionAttitudeTransform::computeWorldToLocalMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeWorldToLocalMatrix@PositionAttitudeTransform@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
2>application.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class osg::Matrixf __cdecl osg::computeLocalToWorld(class std::vector<class osg::Node *,class std::allocator<class osg::Node *> > const &,bool)" (__imp_?computeLocalToWorld@osg@@YA?AVMatrixf@1@ABV?$vector@PAVNode@osg@@V?$allocator@PAVNode@osg@@@std@@@std@@_N@Z),该符号在函数 "public: virtual void __thiscall BoatPositionCallback::operator()(class osg::Node *,class osg::NodeVisitor *)" (??RBoatPositionCallback@@UAEXPAVNode@osg@@PAVNodeVisitor@2@@Z) 中被引用
2>application.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::MatrixTransform::computeLocalToWorldMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeLocalToWorldMatrix@MatrixTransform@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
2>application.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osg::MatrixTransform::computeWorldToLocalMatrix(class osg::Matrixf &,class osg::NodeVisitor *)const " (?computeWorldToLocalMatrix@MatrixTransform@osg@@UBE_NAAVMatrixf@2@PAVNodeVisitor@2@@Z)
2>..\..\bin\Release\oceanExample.exe : fatal error LNK1120: 8 个无法解析的外部命令
2>生成日志保存在“file://f:\VR\osg\osgocean\osgOcean\src\oceanExample\oceanExample.dir\Release\BuildLog.htm”
2>oceanExample - 9 个错误,0 个警告
========== 生成: 0 已成功, 2 已失败, 2 最新, 0 已跳过 ==========


上面是用osg3.0.1和osgOcean1.0.1联合编译时出现的错误。我感觉这应该是OSG版本生级后所出现的问题。对于上面编译时出现的问题,不知道有没有什么解决办法????

该用户从未签到

 楼主| 发表于 2012-4-30 20:14:04 | 显示全部楼层
头文件都包括进来了

该用户从未签到

发表于 2012-5-4 18:13:57 | 显示全部楼层
1、什么叫做联合编译
2、您这问题十有八九是自己把依赖库搞乱了,请仔细检查
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

联系我们

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