知行且执行 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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?