OGRE的第一个程序问题?出错

来源:百度知道 编辑:UC知道 时间:2024/05/26 17:04:53
#include "Ogre.h"
#include "ExampleApplication.h"
#include <windows.h>
// First, we declare a subclass of the ExampleApplication class
class FirstApp : public ExampleApplication
{
public:
FirstApp() { }

/** createScene is pure virtual in ExampleApplication, so we just override it to do nothing.
* What this means is that we'll be creating an empty scene at first.
**/
void createScene(void) { }
};

INT WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,INT) {
FirstApp myApp; // Instanciate our subclass
try { // This try-catch provides a nice way of popping up errors if they occur.
myApp.go(); // ExampleApplication provides a go method, which starts the rendering.
} catch (Ogre::Exception& e) {
MessageBox( NULL, e.getFullDescription().c_str(),
"An exception has occured!",
MB_OK | MB

MB_ICONERROR; 全部大写

LINK : fatal error LNK1104: 无法打开文件“OgreMain_d.lib”
问题出在: 找不到 OgreMain_d.lib 连接库; 可使用:

#pragma comment(lib, "xxx/OgreMain_d.lib") // xxx为OgreMain_d.lib文件所在位置, 一般为sdk目录下, c:/ogresdk/lib/