Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Entry Point Not Found

This thread is locked; no one can reply to it. rss feed Print
Entry Point Not Found
Eric Johnson
Member #14,841
January 2013
avatar

Hello sirs and madams. :)

I am having a bit of an issue with C::B and Allegro 5. As it stands right now, I can write and execute games with ease, but am unable to launch the game directly from the release and/or debug .exe files that are created upon building the application.

Upon building the application, a file is created under my bin/release directory, entitled "test.exe". Should I launch this file, I receive the following error message: "The procedure entry point __gx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll."

In the past I have used Dev C++ as my primary IDE, and it has built Allegro 5 with ease; indeed, I would simply execute its game.exe file, and there you have it. This is not the case with C::B it seems. I am fairly new to C::B, so I am unfamiliar with its mannerisms. Any ideas? ???

Thank you in advance. ;D

relpatseht
Member #5,034
September 2004
avatar

The IDE is only loosely related to your problem. In the future, refer to your compiler. And IDE is just a beefed up text editor.

Anyway, the problem is libstdc++-6.dll is needed to run your program because your program is dynamically linked to runtime libraries. This particular runtime library has all the code for the standard set of C++ libraries (strings, vectors, etc). You can solve your problem in one of four ways:

  1. Copy libstdc++-6.dll from your compiler's directory (probably within the Code::Blocks directory, in this case, but no guarantees) into the same directory as you executable file.

  2. Add the directory containing libstdc++-6.dll to your PATH environment variable. This will cause the new directory to automatically be searched for DLLs by executables.

  3. Copy libstdc++-6.dll into your C:\Windows\system32 directory. This directory is automatically searched by executables for needed DLLs.

  4. Statically link to the runtime library. I'm sure there is a setting for this in C::B somewhere.

The easiest method going forward is probably to statically link. It also means you wont have to distribute a DLL with your executable when giving it out to friends.

Eric Johnson
Member #14,841
January 2013
avatar

Thank you for your response. (My compiler is MinGW.)

I attempted to add the file to my system32 as well as the directory where my builds were being stored, but both returned the same error. Interestingly enough, both times also caused the error to occur whilst testing it in the IDE itself. As a result, I purged the files. :-/

Thus leaving me with options 2 and 4 of your given advice. However, I am quite new to C::B and am unfamiliar with it, so I am unaware as to how that is done. Any advice?

relpatseht
Member #5,034
September 2004
avatar

I see, in that case the runtime libraries you are linking against are not the same as those used in the DLL.

Anyway, statically linking should still fix your problem. If you're using the latest MinGW compiler (based on gcc 4.7) you'll need to add the flags -static-libgcc and -static-libstdc++ to your compiler options.

pkrcel
Member #14,001
February 2012

Care that latest C::B uses GCC-TDM 4.7.1

It differs from vanilla GCC in exactly that, it defaults to linking statically libstdc++...usually throws an error if you pass the compiler flag -static-listdc++ as imentioned in Allegro5 wiki tutorial. (see you other thread).

which linker options are you passing to in C::B project?

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Eric Johnson
Member #14,841
January 2013
avatar

pkrcel: Under "other linker options", I am passing the following...
`pkg-config --cflags --libs allegro allegro_acodec allegro_audio allegro_color allegro_dialog allegro_font allegro_image allegro_main allegro_memfile allegro_primitives allegro_ttf` `pkg-config libxml++-2.6 --cflags --libs` `pkg-config -static-libgcc -static-libstdc++`

Edgar Reynaldo: I believe I downloaded the newest versions. I have attached an image file of what gcc -v replies with.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Eric Johnson
Member #14,841
January 2013
avatar

I am a complete newbie here with linking files and whatnot. :-/
How could I do that?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

IDK if the mingw version 4.7.0 binaries for allegro will work with tdm 4.7.1. You might have to get a different compiler version, or compile allegro yourself.

There is a pre-built mingw 4.5.0 I put together here. (Which you can match with 4.5.0 allegro binaries)
http://sourceforge.net/p/unofficialmingw/
Just unzip it and set your paths and change your compiler in code blocks.

Edit
To link, use the -l flag followed directly by the name of the lib, without the leading lib or the ending .a

To link against libname.a, you would use -lname

pkrcel
Member #14,001
February 2012

Sheegoth said:

pkrcel: Under "other linker options", I am passing the following...
`pkg-config --cflags --libs allegro allegro_acodec allegro_audio allegro_color allegro_dialog allegro_font allegro_image allegro_main allegro_memfile allegro_primitives allegro_ttf` `pkg-config libxml++-2.6 --cflags --libs` `pkg-config -static-libgcc -static-libstdc++`Edgar Reynaldo: I believe I downloaded the newest versions. I have attached an image file of what gcc -v replies with.

A little weird, since you are on windows, and the version of GCC you have is indeed TDM-GGC 4.7.1 (64bit) which comes bundled with latest C::B (since it is the one used to BUILD C::B itself, onlyit's 32bit)

Could you check the output of "pkg-config -static-libgcc -static-libstdc++" on your command line please?

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Eric Johnson
Member #14,841
January 2013
avatar

Should I just type "pkg-config -static-libgcc -static-libstdc++" into my command line, or how should I go about this?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Eric Johnson
Member #14,841
January 2013
avatar

Aah, okay. Thank you kindly. ;D
The command line says it doesn't recognize it.

pkrcel
Member #14,001
February 2012

Yep, so the output is not passed to g++. As expected, I didn't know there was pkg-config for cmd.exe ;D

Kidding aside, could you please make sure in the Compiler Settings -> Global Compiler Settings -> Other Settings Tab you have the Compiler Logging field set to "full command line". (Default in latest C::B)

Then please rebuld your project, and copy the content of the "output" window in a text file you attach here. I'll have a look at how the compiler is invoked.

Thanks

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

pkrcel
Member #14,001
February 2012

Uh...doesn't it get appended for each and every build? I was afraid of a big file.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

pkrcel
Member #14,001
February 2012

Which makes a lot more sense...shame on me.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Eric Johnson
Member #14,841
January 2013
avatar

Hi everyone.

I have decided that, for the time being, I will no longer be using C::B, nor its environment.
Instead, I will now be attempting to compile and build my projects with the command line alone.
Should I ever return to this, and should I need assistance, I'll call.

Thank you for assisting me in the matter. ;D

coaxil
Member #14,855
January 2013

I already passed through building in command line, so I use my IDE and it just does everything all right. It also has neat GDB front-end, really convenient.

Go to: