|
Allegro 5 static linking problem |
hollow
Member #14,570
September 2012
|
Hello! Recently I had this problem while compiling an application. I was trying to static-link the allegro 5.0 DLL file, but I get some errors after it compiled all the files. ..\allegro\lib\liballegro-5.0.6-monolith-static-md.a(wsystem.o):wsystem.c:(.text+0x67d): undefined reference to `GetModuleFileNameExA@16' Does anyone know how to solve these? I have included the lib files, yet it gives these errors. (Which didn't show in the past) |
Neil Roy
Member #2,229
April 2002
|
I use CodeBlocks + MinGW-TDM (4.6.1) and downloaded and use the 5.0.7 binaries. I link the following libraries for static linking... \MinGW32\lib\Allegro5\liballegro-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_acodec-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_audio-5.0.7-static-mt.a \MinGW32\lib\Allegro5\libopenal-1.14-static-mt.a \MinGW32\lib\Allegro5\libvorbisfile-1.3.2-static-mt.a \MinGW32\lib\Allegro5\libvorbis-1.3.2-static-mt.a \MinGW32\lib\Allegro5\liballegro_color-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_dialog-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_font-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_image-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_memfile-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_physfs-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_primitives-5.0.7-static-mt.a \MinGW32\lib\Allegro5\liballegro_ttf-5.0.7-static-mt.a \MinGW32\lib\Allegro5\libdumb-0.9.3-static-mt.a \MinGW32\lib\Allegro5\libFLAC-1.2.1-static-mt.a \MinGW32\lib\Allegro5\libfreetype-2.4.8-static-mt.a \MinGW32\lib\Allegro5\libogg-1.2.1-static-mt.a \MinGW32\lib\Allegro5\libzlib-1.2.5-static-mt.a gdiplus uuid kernel32 winmm psapi opengl32 glu32 user32 comdlg32 gdi32 shell32 ole32 advapi32 ws2_32 shlwapi I keep my MinGW32 in C:\MinGW32. And of course in my code I have #define ALLEGRO_STATICLINK at the top of my code. All works perfectly for me. Oh, and I use the debug versions of Allegro for the debug build naturally. --- |
hollow
Member #14,570
September 2012
|
Thanks, I seem to have all those libs linked. I also defines STATIC_LINK. I still have the same problem, any ideas? Oh, and my MinGW is to up-to-date (4.6.1) So I'm not sure what's the problem o.o |
Neil Roy
Member #2,229
April 2002
|
Do you have the libraries installed okay? Those errors you're getting seems to indicate that the gdiplus library and opengl libraries aren't getting linked in. I would check to make sure you have them. Also make sure the path they're in is okay. Look at the libs you're linking again, check and make sure you have "gdiplus", "opengl32" and "shlwapi" which has been a problem for me missing in the past. --- |
Elias
Member #358
May 2000
|
The order also is important. -- |
hollow
Member #14,570
September 2012
|
I didn't know they had to be in the right order, although they probably are. I will double check it. And I have all the libs included on the right place and such. Then again it used to work in the past and I can't remember modifying anything important. |
Neil Roy
Member #2,229
April 2002
|
Awesome, glad you got it worked out. --- |
hollow
Member #14,570
September 2012
|
I have another question though ^^ My application is loading a font file but I'm forced to have that in my directory just like dlls. Is there a possible way so I can compile my program so I don't need to include a font file in my directory to make it work? So it's basicly compiled in the exe already. Inb4 thanks |
SiegeLord
Member #7,827
October 2006
|
What is it with the perverse compulsion to stick everything into a single file . The general solution for this kind of nonsense is this: http://www.allegro.cc/forums/thread/611083/966377#target "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|