First off my system is windows XP SP3 with codeblocks/mingw 12.11 ( I downloaded the complete version of codeblocks with mingw) and Irrlicht 1.8. I tried to compile and run the following code below (which compiled fine) but when I tried to run it I got this error in a message box:
the procedure entry point __gxx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll
Basically I tried everything now such as copying the libstdc++-6.dll out of the mingw\bin directory and placing it next to the exe in the program debug folder and I also checked the directories within the environment path to see if any other directory might contain a libstdc++-6.dll interfering with the application. I also tried linking with the library file libstdc++.a and setting the linker to lstdc++ but all these different things got me the same error. I also tried to completely remove every path in the environment variables too.
Anyways heres a generic Irrlicht routine, nothing special but its the test case that doesn't work...
Code: Select all
#include <iostream>
#include <C:\irrlicht-1.8\irrlicht-1.8\include\irrlicht.h>
#include <C:\irrlicht-1.8\irrlicht-1.8\include\driverChoice.h>
class MyEventReceiver : public irr::IEventReceiver
{
public:
virtual bool OnEvent(const irr::SEvent& event)
{
// Remember whether each key is down or up
if (event.EventType == irr::EET_KEY_INPUT_EVENT)
KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
return false;
}
// This is used to check whether a key is being held down
virtual bool IsKeyDown(irr::EKEY_CODE keyCode) const
{
return KeyIsDown[keyCode];
}
MyEventReceiver()
{
for (irr::u32 i=0; i<irr::KEY_KEY_CODES_COUNT; ++i)
KeyIsDown[i] = false;
}
private:
// We use this array to store the current state of each key
bool KeyIsDown[irr::KEY_KEY_CODES_COUNT];
};
class video_class
{
private:
irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* gui;
irr::video::E_DRIVER_TYPE driverType;
MyEventReceiver receiver;
irr::scene::ICameraSceneNode* cam;
public:
~video_class()
{
device->drop();
}
video_class()
{
device = NULL ;
driver = NULL;
smgr = NULL;
gui = NULL;
cam = NULL;
int error = video();
std::cout<<"error: "<<error<<std::endl;
std::cout<<"init success!"<<std::endl;
}
int video()
{
driverType = irr::driverChoiceConsole();
if (driverType==irr::video::EDT_COUNT)
{
return 1;
std::cout<<"drivertype error "<<std::endl;
}
device = irr::createDevice(driverType,irr::core::dimension2d<irr::u32>(640, 480), 16, false, false, false, &receiver);
if (device == 0)
{
return 1; // could not create selected driver.
std::cout<<"device error "<<std::endl;
}
if(device != NULL)
{
driver = device->getVideoDriver();
smgr = device->getSceneManager();
gui = device->getGUIEnvironment();
}
cam = smgr->addCameraSceneNodeFPS(0,50.0f,0.01f,-1,0,0,false,0.0f,false,true);
cam->setPosition(irr::core::vector3df(1.32,-1.6,3.45));
cam->setTarget(irr::core::vector3df(1.3,1.75,1.22));
device->getCursorControl()->setVisible(false);
return 0;
}
void run()
{
while(device->run())
{
if (device->isWindowActive())
{
driver->beginScene(true, true, irr::video::SColor(255,0,0,0));
smgr->drawAll();
//draw here
driver->endScene();
device->sleep(50);
}
}
}
};
int main()
{
video_class VIDEO;
VIDEO.run();
return 0;
}