我来到了Ogre wiki 上的第二个 Ogre 教程,按照教程的提示重命名了文件并替换了代码,但是我收到了这个错误:
1>------ Build started: Project: Flight Simulator, Configuration: Debug Win32 ------
1>BaseApplication.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\Jura\Documents\Visual Studio 2010\Projects\Flight Simulator\Debug\Flight Simulator.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我已经google了,但我似乎没有找到答案。
这是来自的代码BasicTutorial2.cpp
:
#include "BasicTutorial2.h"
//-------------------------------------------------------------------------------------
BasicTutorial2::BasicTutorial2(void)
{
}
//-------------------------------------------------------------------------------------
BasicTutorial2::~BasicTutorial2(void)
{
}
//-------------------------------------------------------------------------------------
void BasicTutorial2::createCamera(void)
{
}
//-------------------------------------------------------------------------------------
void BasicTutorial2::createViewports(void)
{
}
//-------------------------------------------------------------------------------------
void BasicTutorial2::createScene(void)
{
}
这是在我的BasicTutorial2.h
文件中:
/*
-----------------------------------------------------------------------------
Filename: BasicTutorial2.h
-----------------------------------------------------------------------------
This source file is part of the
___ __ __ _ _ _
/___\__ _ _ __ ___ / / /\ \ (_) | _(_)
// // _` | '__/ _ \ \ \/ \/ / | |/ / |
/ \_// (_| | | | __/ \ /\ /| | <| |
\___/ \__, |_| \___| \/ \/ |_|_|\_\_|
|___/
Tutorial Framework
http://www.ogre3d.org/tikiwiki/
-----------------------------------------------------------------------------
*/
#ifndef __BasicTutorial2_h_
#define __BasicTutorial2_h_
#include "BaseApplication.h"
class BasicTutorial2 : public BaseApplication
{
public:
BasicTutorial2(void);
virtual ~BasicTutorial2(void);
protected:
virtual void createScene(void);
virtual void createCamera(void);
virtual void createViewports(void);
};
#endif // #ifndef __BasicTutorial2_h_
在目录中,我也有BaseApplication.cpp
,stdafx.cpp
当然还有他们的头文件(BaseApplication.h
和stdafx.h
)。
所以,这是我的目录结构:
Header files
stdafx.h;
BaseApplication.h;
BasicTutorial2.h;
Source files
stdafx.cpp;
BaseApplication.cpp;
BasicTutorial2.cpp;
我希望有人能给我解决方案。我尝试将子系统从“Windows”更改为“控制台”,但没有运气。我也尝试了其他解决方案,但也没有运气。