查看: 3543|回复: 7

求助!小程序编译错误

[复制链接]

该用户从未签到

发表于 2009-5-14 14:22:12 | 显示全部楼层 |阅读模式
运行一个简单的例子 编译时出现错误,不知道如何解决,请各位不吝赐教。
OSG2.4 VS2005的环境:
1>cow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall osgViewer::Viewer::Viewer(void)" (__imp_??0Viewer@osgViewer@@QAE@XZ),该符号在函数 _wmain 中被引用
1>cow.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::View * __thiscall osgViewer::View::asView(void)" (?asView@View@osgViewer@@UAEPAV1osg@@XZ)
1>cow.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osgViewer::View::requestRedraw(void)" (?requestRedraw@View@osgViewer@@UAEXXZ)
1>cow.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osgViewer::View::requestContinuousUpdate(bool)" (?requestContinuousUpdate@View@osgViewer@@UAEX_N@Z)
1>cow.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osgViewer::View::requestWarpPointer(float,float)" (?requestWarpPointer@View@osgViewer@@UAEXMM@Z)
1>cow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual char const * __thiscall osgViewer::Viewer::libraryName(void)const " (__imp_?libraryName@Viewer@osgViewer@@UBEPBDXZ),该符号在函数 "[thunk]:public: virtual char const * __thiscall osgViewer::Viewer::libraryName`vtordisp{4294967292,0}' (void)const " (?libraryName@Viewer@osgViewer@@$4PPPPPPPM@A@BEPBDXZ) 中被引用
1>cow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall osgViewer::Viewer::`vbase destructor'(void)" (__imp_??_DViewer@osgViewer@@QAEXXZ),该符号在函数 "public: virtual void * __thiscall osgViewer::Viewer::`scalar deleting destructor'(unsigned int)" (??_GViewer@osgViewer@@UAEPAXI@Z) 中被引用
1>cow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual class osg::Object * __thiscall osgViewer::Viewer::cloneType(void)const " (__imp_?cloneType@Viewer@osgViewer@@UBEPAVObject@osg@@XZ),该符号在函数 "[thunk]:public: virtual class osg::Object * __thiscall osgViewer::Viewer::cloneType`vtordisp{4294967292,0}' (void)const " (?cloneType@Viewer@osgViewer@@$4PPPPPPPM@A@BEPAVObject@osg@@XZ) 中被引用
1>cow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual class osg::Object * __thiscall osgViewer::Viewer::clone(class osg::CopyOp const &)const " (__imp_?clone@Viewer@osgViewer@@UBEPAVObject@osg@@ABVCopyOp@4@@Z),该符号在函数 "[thunk]:public: virtual class osg::Object * __thiscall osgViewer::Viewer::clone`vtordisp{4294967292,0}' (class osg::CopyOp const &)const " (?clone@Viewer@osgViewer@@$4PPPPPPPM@A@BEPAVObject@osg@@ABVCopyOp@4@@Z) 中被引用
1>cow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual bool __thiscall osgViewer::Viewer::isSameKindAs(class osg::Object const *)const " (__imp_?isSameKindAs@Viewer@osgViewer@@UBE_NPBVObject@osg@@@Z),该符号在函数 "[thunk]:public: virtual bool __thiscall osgViewer::Viewer::isSameKindAs`vtordisp{4294967292,0}' (class osg::Object const *)const " (?isSameKindAs@Viewer@osgViewer@@$4PPPPPPPM@A@BE_NPBVObject@osg@@@Z) 中被引用
1>cow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual char const * __thiscall osgViewer::Viewer::className(void)const " (__imp_?className@Viewer@osgViewer@@UBEPBDXZ),该符号在函数 "[thunk]:public: virtual char const * __thiscall osgViewer::Viewer::className`vtordisp{4294967292,0}' (void)const " (?className@Viewer@osgViewer@@$4PPPPPPPM@A@BEPBDXZ) 中被引用
1>C:\Documents and Settings\Administrator.672257A1A372408\My Documents\Visual Studio 2005\Projects\cow\Debug\cow.exe : fatal error LNK1120: 11 个无法解析的外部命令
1>生成日志保存在“file://c:\Documents and Settings\Administrator.672257A1A372408\My Documents\Visual Studio 2005\Projects\cow\cow\Debug\BuildLog.htm”
1>cow - 12 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========

该用户从未签到

发表于 2009-5-14 14:25:27 | 显示全部楼层
您的程序的的依赖库中包括osgViewer.lib了吗

该用户从未签到

 楼主| 发表于 2009-5-14 15:01:53 | 显示全部楼层
的确少了这个  谢谢array大哥!!

该用户从未签到

发表于 2009-7-21 16:19:33 | 显示全部楼层
错误        3        error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall osg::ApplicationUsage::getCommandLineUsage(void)const " (__imp_?getCommandLineUsage@ApplicationUsage@osg@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ),该符号在函数 _main 中被引用osgversion.obj       
王锐老师,链接程序时出现了这个问题?怎么解决

该用户从未签到

发表于 2009-7-21 16:26:32 | 显示全部楼层
我没有遇到过这个问题?不知您的源代码包是否完整

该用户从未签到

发表于 2009-7-21 16:47:39 | 显示全部楼层
上个问题解决了,现在又有问题了,用VS2005调试运行OSG程序的时候,弹出对话框提示
osganimate.exe中的0x7c812a5b处未处理的异常:microsoft c++异常;内存位置0x0012e8a
a0处std::bad_alloc
这是怎么回事?怎么解决?

该用户从未签到

发表于 2009-7-21 16:57:09 | 显示全部楼层
请检查您的工程配置:依赖库是否正确,是否存在Debug和Release版本混用;是否存在所用的DLL与LIB库不符的情形

该用户从未签到

发表于 2009-7-22 10:20:07 | 显示全部楼层
好,谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

联系我们

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