Rysiek Temat założony przez niniejszego użytkownika |
Plik nie może zostać otwarty » 2013-07-13 22:43:28 Napisałem program w Microsoft Visual C++ używając Biblioteki Irrlicht. Wszystko ładnie nie pokazuje żadnych błędów ale podczas debugowania wyskakuje mi błąd: fatal error LNK1104: cannot open file Gra3D.exe. Jakby co to załączam kod Main.cpp: #include <irrlicht.h> #include <cstdlib> using namespace irr; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui;
#ifdef _IRR_WINDOWS_ #pragma comment(lib, "Irrlicht.lib") #pragma comment(linker, "/subsytem:windows /ENTRY:mainCRTStartup") #endif int main() { IrrlichtDevice * device = createDevice( video::EDT_SOFTWARE, dimension2d < u32 >( 640, 480 ), 16, true, true, true, 0 ); if( !device ) return 1; device->setWindowCaption( L"Hello World! - Irrlicht Engine Demo" ); IVideoDriver * driver = device->getVideoDriver(); ISceneManager * smgr = device->getSceneManager(); IGUIEnvironment * guienv = device->getGUIEnvironment(); guienv->addStaticText( L"Hello World! This is the Irrlicht Software renderer!", rect < s32 >( 10, 10, 260, 22 ), true ); IAnimatedMesh * mesh = smgr->getMesh( "C:Document and Setting/Rysio/Moje dokumenty/Downloads/irrlicht-1.8/media/gun.md2" ); if( !mesh ) { device->drop(); return 1; } IAnimatedMeshSceneNode * node = smgr->addAnimatedMeshSceneNode( mesh ); if( node ) { node->setMaterialFlag( EMF_LIGHTING, false ); node->setMD2Animation( scene::EMAT_STAND ); node->setMaterialTexture( 0, driver->getTexture( "C:Document and Setting/Rysio/Moje dokumenty/Downlaods/irrlicht-1.8/media/gun.jpeg" ) ); } smgr->addCameraSceneNode( 0, vector3df( 0, 30, - 40 ), vector3df( 0, 5, 0 ) ); while( device->run() ) { driver->beginScene( true, true, SColor( 255, 100, 101, 140 ) ); smgr->drawAll(); guienv->drawAll(); driver->endScene(); } device->drop(); return 0; system( "pause" ); } oraz Quake3D.cpp: #include <irrlicht.h> #include <iostream> #include <cstdlib> using namespace std; using namespace irr;
#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") #endif
int main() { video::E_DRIVER_TYPE driverType; printf( "Proszę wybrać sterownik, który ma zostać użyty dla tego przykładu:\n" "Proszę wybrać sterownik, który ma zostać użyty dla tego przykładu:\n"\ " (a) OpenGL 1.5\n (b) Direct3D 9.0c\n (c) Direct3D 8.1\n" " (a) OpenGL 1.5\n (b) Direct3D 9.0c\n (c) Direct3D 8.1\n"\ " (f) NullDevice\n (otherKey) exit\n\n" ); char i; cin >> i; switch( i ) { case 'a': driverType = video::EDT_OPENGL; break; case 'b': driverType = video::EDT_DIRECT3D9; break; case 'c': driverType = video::EDT_DIRECT3D8; break; case 'd': driverType = video::EDT_BURNINGSVIDEO; break; case 'e': driverType = video::EDT_SOFTWARE; break; case 'f': driverType = video::EDT_NULL; break; default: return 1; } IrrlichtDevice * device = createDevice( driverType, core::dimension2d < u32 >( 640, 480 ) ); if( device == 0 ) return 1; video::IVideoDriver * driver = device->getVideoDriver(); scene::ISceneManager * smgr = device->getSceneManager(); device->getFileSystem()->addFileArchive( "C:/Document and Settings/Rysio/Moje dokumenty/Downloads/irrlicht-1.8/media/map-20kdm2.pk3" ); scene::IAnimatedMesh * mesh = smgr->getMesh( "20kdm2.bsp" ); scene::ISceneNode * node = 0; if( mesh ) node = smgr->addOctreeSceneNode( mesh->getMesh( 0 ), 0, - 1, 1024 ); if( node ) node->setPosition( core::vector3df( - 1400, - 200, - 1500 ) ); smgr->addCameraSceneNodeFPS(); device->getCursorControl()->setVisible( true ); int lastFPS = - 1; while( device->run() ) { if( device->isWindowActive() ) { driver->beginScene( true, true, video::SColor( 255, 200, 200, 200 ) ); smgr->drawAll(); driver->endScene(); int fps = driver->getFPS(); if( lastFPS != fps ) { core::stringw str = L"Irrlicht Engine - Quake 3 Map Example ["; str += driver->getName(); str += "] FPS:"; str += fps; device->setWindowCaption( str.c_str() ); lastFPS = fps; } } else device->yield(); } device->drop(); system( "pause" ); return 0; } Strasznie mnie ciekawi dlaczego tak się dzieje. |
|
pekfos |
» 2013-07-13 22:46:22 A wyłączyłeś grę? |
|
Savail |
» 2013-07-13 22:48:09 W głównym folderze swojej aplikacji wykasuj wszystko z folderów Release/Debug. Są 2 foldery jakby co, w głównej lokalizacji i o 1 poziom głębiej. Po wykasowaniu plików z tych folderów wystarczy że skompilujesz aplikację ponownie i powinno działać. To taki bug Visuala :d |
|
Rysiek Temat założony przez niniejszego użytkownika |
» 2013-07-13 22:57:49 Tak wyłączyłem, w folderach z projektem jest Gra3D oraz debug oraz inne pliki wchodzę Gra3D i znowuż jest debug, nie ma folderu Release |
|
Savail |
» 2013-07-13 22:59:56 Nie ma dlatego, że pewnie nie kompilowałeś w trybie Release. W takim wypadku wykasuj tylko to co znajdziesz w folderach Debug |
|
Rysiek Temat założony przez niniejszego użytkownika |
» 2013-07-13 23:11:56 Zadziałało, dzięki |
|
« 1 » |