|
Allegro 5.2.3 DirectX build errors |
BitCruncher
Member #11,279
August 2009
|
Windows 10 Building makefile with cmake Stops at 9% with these errors. Any ideas? In file included from C:\devel\allegro5\src\win\whapxi.c:67:0:
|
SiegeLord
Member #7,827
October 2006
|
The CMake is picking up the official SDK, with doesn't work with MinGW. Mingw-w64 comes with its own copy of the headers/libaries, so all you need to do is point Allegro it them. Easiest way is to run export DXSDK_DIR=... in the shell before calling cmake. I forget what to put there, but you can experiment. It might be F:\msys64\mingw32\i686-w64-mingw32 or the equivalent for your installation. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
BitCruncher
Member #11,279
August 2009
|
Thanks. It seems like most of these errors are caused by the compiler not knowing where to look for the includes. Here is another for stdlib.h (which is strange). EDIT: For most versions of mingw, the includes are in mingw/include, but my version has two include directories: "mingw32/include" and "mingw32/i686-w64-mingw32/include". stdlib.h is in the second. Maybe the compiler is only looking in the first... In file included from C:/mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/gcc/i686-w64-mingw32/7.2.0/include/c++/ext/string_conversions.h:41:0,
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
You need to point cmake to 'mingw32/i686-w64-mingw32/include' and mingw32/i686-w64-mingw32/lib' for DirectX to be picked up properly. That's also where you should be installing things. MinGW-W64 is a little odd that way. Edit My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
SiegeLord
Member #7,827
October 2006
|
And that's a bug that I'll fix today. Attached is the WIP patch. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
BitCruncher
Member #11,279
August 2009
|
Finally got a compile out of 5.2.3. Evidently, the bug is only in 5.2.0. EDIT: So this is what I have after compiling the monolithic version of the library.
g++ -c -g -I../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/include -MMD -MP -MF "build/Debug/MinGW-Windows/sources/main.o.d" -o build/Debug/MinGW-Windows/sources/main.o sources/main.cpp
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Sorry, this thread slipped my mind. Here is the full list of static libraries to link to when on Windows : -static -ljpeg -ldumb -lFLAC -lfreetype -lvorbisfile -lvorbis -logg -lphysfs -lpng16 -lzlibstatic -ldsound -lgdiplus -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi -static-libstdc++ -static-libgcc This tells the linker to static link all of the following libraries : -static These are the optional dependencies you compiled support for when building allegro (omit any you didn't build support for) : -ljpeg -ldumb -lFLAC -lfreetype -lvorbisfile -lvorbis -logg -lphysfs -lpng16 -lzlibstatic These are the Windows libraries. You must link all of these. -ldsound -lgdiplus -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi And last but not least, the C Run Time libraries : -static-libstdc++ -static-libgcc
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
BitCruncher
Member #11,279
August 2009
|
I'll come back to the static build later. Right now, I'm getting undefined reference errors for functions in the ttf addon like al_init_ttf_addon(). Are these gone in 5.2.3? EDIT: When I configured the allegro build in cmake, the output says that the TTF_COMPILES test failed, and that freetype doesn't compile.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Just link to the Allegro monolith dll. You can't link to an add-on you didn't build so you can't usethosefunctions My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
SiegeLord
Member #7,827
October 2006
|
Is your freetype library static? If so, you may need to specify what dependencies freetype needs, e.g. `-DFREETYPE_ZLIB=on -DFREETYPE_PNG=on -DFREETYPE_BZIP2=on`. Only specify the ones you need. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
BitCruncher
Member #11,279
August 2009
|
I left out a bunch of steps that I did beforehand. I built the alleg dependencies from the repo on github with msys. Whichever way FreeType was configured to build when I ran build_deps_msys_32.sh, that's what I'm using. The lib file ends in .a, so I guess it's static?
|
SiegeLord
Member #7,827
October 2006
|
Yep, that's static. You then want `-DFREETYPE_ZLIB=on -DFREETYPE_PNG=on` (that goes on the command line when invoking Allegro's cmake, if that wasn't clear). "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
BitCruncher
Member #11,279
August 2009
|
That worked. Finally got a dynamic build, but static linking still gives me those errors above. I included the commands to the linker; the only thing I had to change was "-lzlibstatic" to "-lzlib" because I don't have a "libzlibstatic.a", just "libzlib.a".
|
SiegeLord
Member #7,827
October 2006
|
Did you add them after -lallegro and the gang? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
BitCruncher
Member #11,279
August 2009
|
This is what my linker options are. I didn't put -lallegro in the linker options, but in "link libraries".
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
I wouldn't use the 'link libraries' tab, but instead properly add the path to the libraries in 'search directories' for the 'linker' and then add everything in the correct order in 'linker options'. Also, create one project build per build type. You can set all the include and link directories in the main project, and then set the specific libraries to link in the sub build linker options. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|