首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络游戏 >

一段小程序老是出现如下异常?sdk ogre

2013-11-25 
一段小程序老是出现如下错误???sdk ogre#include ExampleApplication.h class MyApplication :public Ex

一段小程序老是出现如下错误???sdk ogre
#include "ExampleApplication.h" 

class MyApplication :public ExampleApplication 

public: 
void createScene() 

Ogre::Entity* ent = mSceneMgr->createEntity("myentity", "Sinbad.mesh"); 
Ogre::SceneNode* node1 = mSceneMgr->createSceneNode("node1"); 
node1->setPosition(10, 0, 0); 
mSceneMgr->getRootSceneNode()->addChild(node1); 
node1->attachObject(ent); 

Ogre::Entity* ent2 = mSceneMgr->createEntity("myentity2", "Sinbad.mesh"); 
Ogre::SceneNode* node2 = mSceneMgr->createSceneNode("node2"); 
node2->setPosition(0, 10, 20); 
node1->addChild(node2); 
node2->attachObject(ent2); 

// mSceneMgr->getRootSceneNode()->attachObject(ent); 


private: 

}; 

int main() 

MyApplication app; 
app.go(); 
return 0; 
}


错误提示:

main.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall Ogre::FrameListener::frameStarted(struct Ogre::FrameEvent const &)" (?frameStarted@FrameListener@Ogre@@UAE_NABUFrameEvent@2@@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Ogre::RenderQueueListener::postRenderQueues(void)" (?postRenderQueues@RenderQueueListener@Ogre@@UAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Ogre::RenderQueueListener::preRenderQueues(void)" (?preRenderQueues@RenderQueueListener@Ogre@@UAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Ogre::RenderQueueListener::renderQueueEnded(unsigned char,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool &)" (?renderQueueEnded@RenderQueueListener@Ogre@@UAEXEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AA_N@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Ogre::OverlaySystem::renderQueueStarted(unsigned char,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool &)" (?renderQueueStarted@OverlaySystem@Ogre@@UAEXEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AA_N@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall Ogre::WindowEventListener::windowClosing(class Ogre::RenderWindow *)" (?windowClosing@WindowEventListener@Ogre@@UAE_NPAVRenderWindow@2@@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Ogre::WindowEventListener::windowFocusChange(class Ogre::RenderWindow *)" (?windowFocusChange@WindowEventListener@Ogre@@UAEXPAVRenderWindow@2@@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall Ogre::WindowEventListener::windowMoved(class Ogre::RenderWindow *)" (?windowMoved@WindowEventListener@Ogre@@UAEXPAVRenderWindow@2@@Z)


还有警告:

e:\ogresdk_vc11_x64_v1-9-0unstable\include\ogre\ogremath.h : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
1>e:\ogresdk_vc11_x64_v1-9-0unstable\include\ogre\exampleframelistener.h(346): warning C4244: “+=”: 从“double”转换到“Ogre::Real”,可能丢失数据
1>e:\ogresdk_vc11_x64_v1-9-0unstable\include\ogre\exampleframelistener.h(347): warning C4244: “-=”: 从“double”转换到“Ogre::Real”,可能丢失数据
1>e:\ogresdk_vc11_x64_v1-9-0unstable\include\ogre\exampleframelistener.h(351): warning C4244: “参数”: 从“double”转换到“Ogre::Real”,可能丢失数据
1>e:\ogresdk_vc11_x64_v1-9-0unstable\include\ogre\exampleframelistener.h(352): warning C4244: “参数”: 从“double”转换到“Ogre::Real”,可能丢失数据
1>e:\ogresdk_vc11_x64_v1-9-0unstable\include\ogre\exampleframelistener.h(457): warning C4244: “-=”: 从“double”转换到“Ogre::Real”,可能丢失数据
[解决办法]
无法解析的外部符

意味这 
1. 你可能没有包含改符号所在的lib库
2. 你可能没有包含改符号所在的cpp

大部分错误发生在这2个阶段,更多的请参考msdn

热点排行