知行且执行 2014-09-14 06:38 采纳率: 0%
浏览 3961

OSG使用VS2012报错error LNK2019

#include
#include
#include

int main()
{
osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer;
viewer->addEventHandler(new osgViewer::StatsHandler);//加上这一句就错
viewer->setSceneData(osgDB::readNodeFile("cow.osg"));
return viewer->run();
}
加上以上一句才报错,说明环境配置没有问题,怎么回事?
报错:
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual class osg::Object * thiscall osgGA::GUIEventHandler::cloneType(void)const " (imp_?cloneType@GUIEventHandler@osgGA@@UBEPAVObject@osg@@XZ),该符号在函数 "[thunk]:public: virtual class osg::Object * thiscall osgGA::GUIEventHandler::cloneTypevtordisp{4294967292,144}' (void)const " (?cloneType@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPAVObject@osg@@XZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual class osg::Object * __thiscall osgGA::GUIEventHandler::clone(class osg::CopyOp const &)const " (__imp_?clone@GUIEventHandler@osgGA@@UBEPAVObject@osg@@ABVCopyOp@4@@Z),该符号在函数 "[thunk]:public: virtual class osg::Object * __thiscall osgGA::GUIEventHandler::clone
vtordisp{4294967292,144}' (class osg::CopyOp const &)const " (?clone@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPAVObject@osg@@ABVCopyOp@4@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "
declspec(dllimport) public: virtual bool thiscall osgGA::GUIEventHandler::isSameKindAs(class osg::Object const *)const " (imp_?isSameKindAs@GUIEventHandler@osgGA@@UBE_NPBVObject@osg@@@Z),该符号在函数 "[thunk]:public: virtual bool thiscall osgGA::GUIEventHandler::isSameKindAsvtordisp{4294967292,144}' (class osg::Object const *)const " (?isSameKindAs@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BE_NPBVObject@osg@@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual char const * __thiscall osgGA::GUIEventHandler::libraryName(void)const " (__imp_?libraryName@GUIEventHandler@osgGA@@UBEPBDXZ),该符号在函数 "[thunk]:public: virtual char const * __thiscall osgGA::GUIEventHandler::libraryName
vtordisp{4294967292,144}' (void)const " (?libraryName@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPBDXZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "
declspec(dllimport) public: virtual char const * thiscall osgGA::GUIEventHandler::className(void)const " (imp_?className@GUIEventHandler@osgGA@@UBEPBDXZ),该符号在函数 "[thunk]:public: virtual char const * __thiscall osgGA::GUIEventHandler::className`vtordisp{4294967292,144}' (void)const " (?className@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPBDXZ) 中被引用
1>D:\WorkPlace\OSG2012\LearningOSG\Debug\1_1_StartOSG.exe : fatal error LNK1120: 5 个无法解析的外部命令

求解?

  • 写回答

2条回答 默认 最新

  • hw20042562 2015-10-12 07:15
    关注

    添加 #pragma comment(lib,"osgGAd.lib")

    评论

报告相同问题?

悬赏问题

  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?