|
示例代码:
// HELLO3.cpp : 定义控制台应用程序的入口点。
//
#ifdef _DEBUG
#pragma comment(lib,"osgViewerd.lib")
#pragma comment(lib,"osgDBd.lib")
#pragma comment(lib,"OpenThreadsd.lib")
#pragma comment(lib,"osgd.lib")
#else
#pragma comment(lib,"osgViewer.lib")
#pragma comment(lib,"osgDB.lib")
#pragma comment(lib,"OpenThreads.lib")
#pragma comment(lib,"osg.lib")
#endif
#include "stdafx.h"
#include<osgViewer/Viewer>
#include<osgDB/ReadFile>
int _tmain(int argc, _TCHAR* argv[])
{
osg::ref_ptr<osgViewer::Viewer>viewer = new osgViewer::Viewer;
viewer->setSceneData(osgDB::readNodeFile("glider.osg"));
return viewer->run();
}
出错日志:
1>------ 已启动生成: 项目: HELLO3, 配置: Debug Win32 ------
1> HELLO3.cpp
1>HELLO3.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall osg::Referenced::ref(void)const " (__imp_?ref@Referenced@osg@@QBEHXZ),该符号在函数 "public: __thiscall osg::ref_ptr<class osgViewer::Viewer>::ref_ptr<class osgViewer::Viewer>(class osgViewer::Viewer *)" (??0?$ref_ptr@VViewer@osgViewer@@@osg@@QAE@PAVViewer@osgViewer@@@Z) 中被引用
1>HELLO3.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall osg::Referenced::unref(void)const " (__imp_?unref@Referenced@osg@@QBEHXZ),该符号在函数 "public: __thiscall osg::ref_ptr<class osgViewer::Viewer>::~ref_ptr<class osgViewer::Viewer>(void)" (??1?$ref_ptr@VViewer@osgViewer@@@osg@@QAE@XZ) 中被引用
1>HELLO3.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall osgViewer::Viewer::Viewer(void)" (__imp_??0Viewer@osgViewer@@QAE@XZ),该符号在函数 _wmain 中被引用
1>HELLO3.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>HELLO3.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>HELLO3.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>HELLO3.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>HELLO3.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>HELLO3.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>HELLO3.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class osgDB::Registry * __cdecl osgDB::Registry::instance(bool)" (__imp_?instance@Registry@osgDB@@SAPAV12@_N@Z),该符号在函数 "class osg::Node * __cdecl osgDB::readNodeFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
1>HELLO3.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class osgDB::Options * __thiscall osgDB::Registry::getOptions(void)" (__imp_?getOptions@Registry@osgDB@@QAEPAVOptions@2@XZ),该符号在函数 "class osg::Node * __cdecl osgDB::readNodeFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
1>HELLO3.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class osg::Node * __cdecl osgDB::readNodeFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class osgDB::Options const *)" (__imp_?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBVOptions@1@@Z),该符号在函数 "class osg::Node * __cdecl osgDB::readNodeFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 中被引用
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::Node * __thiscall osg::Object::asNode(void)" (?asNode@Object@osg@@UAEPAVNode@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::Node const * __thiscall osg::Object::asNode(void)const " (?asNode@Object@osg@@UBEPBVNode@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::NodeVisitor * __thiscall osg::Object::asNodeVisitor(void)" (?asNodeVisitor@Object@osg@@UAEPAVNodeVisitor@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::NodeVisitor const * __thiscall osg::Object::asNodeVisitor(void)const " (?asNodeVisitor@Object@osg@@UBEPBVNodeVisitor@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::StateAttribute * __thiscall osg::Object::asStateAttribute(void)" (?asStateAttribute@Object@osg@@UAEPAVStateAttribute@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::StateAttribute const * __thiscall osg::Object::asStateAttribute(void)const " (?asStateAttribute@Object@osg@@UBEPBVStateAttribute@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::Uniform * __thiscall osg::Object::asUniform(void)" (?asUniform@Object@osg@@UAEPAVUniform@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::Uniform const * __thiscall osg::Object::asUniform(void)const " (?asUniform@Object@osg@@UBEPBVUniform@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::View * __thiscall osgViewer::View::asView(void)" (?asView@View@osgViewer@@UAEPAV1osg@@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osg::Object::computeDataVariance(void)" (?computeDataVariance@Object@osg@@UAEXXZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osgViewer::View::computeIntersections(class osgGA::GUIEventAdapter const &,class std::multiset<struct osgUtil: ineSegmentIntersector::Intersection,struct std::less<struct osgUtil::LineSegmentIntersector::Intersection>,class std::allocator<struct osgUtil::LineSegmentIntersector::Intersection> > &,unsigned int)" (?computeIntersections@View@osgViewer@@UAE_NABVGUIEventAdapter@osgGA@@AAV?$multiset@UIntersection@LineSegmentIntersector@osgUtil@@U?$less@UIntersection@LineSegmentIntersector@osgUtil@@@std@@V?$allocator@UIntersection@LineSegmentIntersector@osgUtil@@@5@@std@@I@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall osgViewer::View::computeIntersections(class osgGA::GUIEventAdapter const &,class std::vector<class osg::Node *,class std::allocator<class osg::Node *> > const &,class std::multiset<struct osgUtil::LineSegmentIntersector::Intersection,struct std::less<struct osgUtil::LineSegmentIntersector::Intersection>,class std::allocator<struct osgUtil::LineSegmentIntersector::Intersection> > &,unsigned int)" (?computeIntersections@View@osgViewer@@UAE_NABVGUIEventAdapter@osgGA@@ABV?$vector@PAVNode@osg@@V?$allocator@PAVNode@osg@@@std@@@std@@AAV?$multiset@UIntersection@LineSegmentIntersector@osgUtil@@U?$less@UIntersection@LineSegmentIntersector@osgUtil@@@std@@V?$allocator@UIntersection@LineSegmentIntersector@osgUtil@@@5@@6@I@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::Referenced * __thiscall osg::Object::getUserData(void)" (?getUserData@Object@osg@@UAEPAVReferenced@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual class osg::Referenced const * __thiscall osg::Object::getUserData(void)const " (?getUserData@Object@osg@@UBEPBVReferenced@2@XZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osg::Object::releaseGLObjects(class osg::State *)const " (?releaseGLObjects@Object@osg@@UBEXPAVState@2@@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osgViewer::View::requestContinuousUpdate(bool)" (?requestContinuousUpdate@View@osgViewer@@UAEX_N@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osgViewer::View::requestRedraw(void)" (?requestRedraw@View@osgViewer@@UAEXXZ)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osgViewer::View::requestWarpPointer(float,float)" (?requestWarpPointer@View@osgViewer@@UAEXMM@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osg::Object::resizeGLObjectBuffers(unsigned int)" (?resizeGLObjectBuffers@Object@osg@@UAEXI@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osg::Object::setName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setName@Object@osg@@UAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool)" (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1>HELLO3.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall osg::Object::setUserData(class osg::Referenced *)" (?setUserData@Object@osg@@UAEXPAVReferenced@2@@Z)
1>D:\示例练习\VC\HELLO3\Debug\HELLO3.exe : fatal error LNK1120: 34 个无法解析的外部命令
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
请各位大神帮忙看一下,已经试了网上的很多方法,都没用,快崩溃了
|
|