[SOLVED] libstdc++-6.dll error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

[SOLVED] libstdc++-6.dll error

Post by pandoragami »

Hi,

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;
}
 
Last edited by pandoragami on Thu Jan 24, 2013 12:03 pm, edited 1 time in total.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: libstdc++-6.dll error

Post by serengeor »

Recompile irrlicht library with the same compiler and link with newly compiled library, that should probably fix it afaik :roll:
Working on game: Marrbles (Currently stopped).
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Re: libstdc++-6.dll error

Post by pandoragami »

Recompile irrlicht library with the same compiler and link with newly compiled library, that should probably fix it afaik
I guess but its not that simple to just compile the Irrlicht source. It doesn't include anything like a configure file to begin with and I'm not sure how to go about making one myself. Is there a different source laying around somewhere else on the site I'm not familiar with?
CuteAlien
Admin
Posts: 10066
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: libstdc++-6.dll error

Post by CuteAlien »

Configuration files for code::blocks exist. Use the Irrlicht.cbp file in source/irrlicht folder.

But first try if you get the same error when compiling&running one of the example in the examples folder (there's also a .cbp project file for those for Code::Blocks).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Re: libstdc++-6.dll error

Post by pandoragami »

CuteAlien wrote:Configuration files for code::blocks exist. Use the Irrlicht.cbp file in source/irrlicht folder.

But first try if you get the same error when compiling&running one of the example in the examples folder (there's also a .cbp project file for those for Code::Blocks).

I tried running 01.HelloWorld and that too had the same message box error with libstdc++6.dll. Do I just open Irrlicht-gcc.cbp and select build?
CuteAlien
Admin
Posts: 10066
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: libstdc++-6.dll error

Post by CuteAlien »

For rebuilding that should be all. But I'm not certain what the error message means and if rebuilding fixes it.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Re: libstdc++-6.dll error

Post by pandoragami »

CuteAlien wrote:For rebuilding that should be all. But I'm not certain what the error message means and if rebuilding fixes it.
I got Irrlicht example 1 to run but as for the other program I first posted (the test file) it still doesn't work. I checked the libraries for example 1 and it just says Irrlicht in codeblocks (in the link libraries editor under linker settings). My test file was set to the lib folder:

C:\irrlicht-1.8\irrlicht-1.8\lib\Win32-gcc\libIrrlicht.a

with no linker options on the right pane. Any ideas why? I still get the dll error from before?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: libstdc++-6.dll error

Post by serengeor »

Well you're still probably linking with wrong library, if you're using .dll be sure to replace with new one. Just double check if the libraries you're linking with are compiled with the same compiler, version and you should be fine, I think :roll:
Working on game: Marrbles (Currently stopped).
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Re: libstdc++-6.dll error

Post by pandoragami »

serengeor wrote:Well you're still probably linking with wrong library, if you're using .dll be sure to replace with new one. Just double check if the libraries you're linking with are compiled with the same compiler, version and you should be fine, I think :roll:

I searched the Irrlicht-1.8 directory for every file named libIrrlicht.a and its the only one in the folder

C:\irrlicht-1.8\irrlicht-1.8\lib\Win32-gcc\libIrrlicht.a

I also put the Irrlicht.DLL next to the test.exe from the folder:

C:\irrlicht-1.8\irrlicht-1.8\bin\Win32-gcc

I then moved the Irrlicht.DLL into the system32 folder along with the libstdc++-6.DLL just to make sure its global and still nothing happens. I assume that when codeblocks rebuilt irrlicht it just replaced the llibIrrlicht.a file and the irrlicht.dll ? Otherwise where does codeblocks put the new irrlicht files?
CuteAlien
Admin
Posts: 10066
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: libstdc++-6.dll error

Post by CuteAlien »

The project file set's "Irrlicht" in the linker tab as you found - but it also does set "..\..\lib\Win32-gcc" in Search Directories - Linker to find it.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Re: libstdc++-6.dll error

Post by pandoragami »

CuteAlien wrote:The project file set's "Irrlicht" in the linker tab as you found - but it also does set "..\..\lib\Win32-gcc" in Search Directories - Linker to find it.

I looked at the search directories and under the compiler tab I only found ..\..\include. I'm pretty sure a makefile is used btw.

I did end up solving the problem by downloading the latest version of mingw from their site and using the libstdc++-6.dll from their version instead of the codeblocks by copying one inside the directory c:\windows\system32. It seemed to work. The strange thing abut this is that I compiled Irrlicht with codeblocks yet the libraries in mingw aren't compatible with the Irrlicht library? Plus the non codeblocks mingw libstdc++-6.dll file is 1/6 (the one that worked with irrlicht) the size of the other codeblocks mingw one which is 6 megs.
CuteAlien
Admin
Posts: 10066
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: libstdc++-6.dll error

Post by CuteAlien »

Not in the compiler tab - as I wrote it's in the linker tab (per platform, so not in general).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Re: libstdc++-6.dll error

Post by pandoragami »

CuteAlien wrote:Not in the compiler tab - as I wrote it's in the linker tab (per platform, so not in general).
Yeah I checked its not there (for the example 1). I did set the linker and search settings in my test program and tried running it without libstdc++-6.dll in system32 and sure enough it didn't work. Then I placed the libstdc++-6.dll file right next to the test.exe in the debug folder along with irrlicht.dll and it runs fine. I guess the thread is solved although I'll take your suggestions if you have any new ones. Thanks for the help though.
CuteAlien
Admin
Posts: 10066
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [SOLVED] libstdc++-6.dll error

Post by CuteAlien »

If it works it's good. But still confused why the linker path didn't show up in your case - it is there (I just checked again to be certain).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Ruxify
Posts: 33
Joined: Tue Oct 16, 2012 12:37 am

Re: [SOLVED] libstdc++-6.dll error

Post by Ruxify »

OMG This was exactly the problem I was having!

I fixed it by getting the new libstdc++-6.dll and I also got another .dll it was missing.

Now I can actually USE Irrlicht. xD
Post Reply