#include
class SampleApp : public ExampleApplication
{
public:
SampleApp()
{
}
protected:
void createScene(void)
{
// put scene creation code here
// set default light
mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );
// create object in default scene root pos
Entity *ent1 = mSceneMgr->createEntity( "Robot",
"robot.mesh" );
SceneNode *node1 = mSceneMgr->getRootSceneNode()
->createChildSceneNode( "RobotNode" );
node1->attachObject( ent1 );
}
};
#pragma comment(lib, "OIS_d.lib")
#pragma comment(lib, "OgreMain_d.lib")
int main(int argc, char **argv)
{
// instanciate our class
SampleApp myApp;
try
{
// ExampleApplication provides a go method,
// which start rendering
myApp.go();
}
catch( Ogre::Exception& e )
{
std::cerr << "Exception:\n";
std::cerr << e.getFullDescription().c_str() << "\n";
return 1;
}
return 0;
}
////////////////////////////////////////////////////////////////
'exp1.exe': Loaded 'C:\Documents and Settings\home\Mes documents\Visual Studio 2005\Projects\exp1\debug\exp1.exe', Symbols loaded.
'exp1.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'exp1.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'exp1.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', No symbols loaded.
'exp1.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
The program '[2704] exp1.exe: Native' has exited with code 0 (0x0).
أما في 22/ذو القعدة/1430 05:53 ص، فقد تنهد وسام البهنسي بارتياح وهو يرد:
عندما تنفذ البرنامج، هل تظهر أية نوافذ؟ unable to start program "..\\ common \bin\Debug\tutoriel1.exe
بحيث tutoriel1 هو اسم المشروع1>c:\ \projects\tutoriel1\tutoriel1\src\tutoriel1.cpp(20) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
1>tutoriel1pp.cpp
1>c:\ogresdk\include\win32\ogretimerimp.h(35) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
1>Generating Code...
1>Build log was saved at "file://c:\Projects\tutoriel1\tutoriel1\obj\Debug\BuildLog.htm"
1>tutoriel1 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
#include
#include "..\include\Tutoriel1App.h"
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char *argv[])
#endif
{
// Create application object
//Tutoriel1App app;
SET_TERM_HANDLER;
try {
//app.go();
} catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occured: " <<
e.getFullDescription().c_str() << std::endl;
#endif
}
return 0;
}
#ifdef __cplusplus
}
#endif
#include
#include "windows.h"
وفي 24/ذو القعدة/1430 05:13 ص، أعرب عبد اللطيف حاجي علي عن رأيه بالموقف كالآتي:
اكتب#include
#include "windows.h"