知行且执行 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 C#读写EXCEL文件,不同编译
  • ¥15 如何提取csv文件中需要的列,将其整合为一篇完整文档,并进行jieba分词(语言-python)
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置