Allegro 5.2.2 Setup
DragonDePlatino

I just got a new HDD so I need to set up my allegro environment from scratch. I've done this before but I'm having trouble doing it again. Specifically, I want to statically link the 64-bit version of allegro 5.2.2 in Windows 8. In order I have:

  1. Installed CodeBlocks with mingw pre-installed via codeblocks-16.01mingw-setup.exe from here.

  2. Installed the allegro-mingw-gcc6.2.0-x64-static-5.2.2 library from here

  3. Installed the allegro_deps-mingw-gcc6.2.0-x64-1.5.0 dependencies from here

  4. Moved the pre-installed mingw to C:\MinGW.

  5. Moved the above two libraries to C:\MinGW\allegro and C:\MinGW\allegro_deps respectively.

  6. Linked all of the libraries and dependencies, defined ALLEGRO_STATICLINK, added the include directories and added the linker options "-static" and "-static-libgcc".

I can compile basic C programs and the compiler is locating all the files but it's having trouble finding the allegro functions in the library. I'm at a loss here. Here is my CodeBlocks project:

#SelectExpand
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 2<CodeBlocks_project_file> 3 <FileVersion major="1" minor="6" /> 4 <Project> 5 <Option title="Crucis" /> 6 <Option pch_mode="2" /> 7 <Option compiler="gcc" /> 8 <Build> 9 <Target title="Debug"> 10 <Option output="bin-debug/Crucis" prefix_auto="1" extension_auto="1" /> 11 <Option object_output="obj-debug/" /> 12 <Option type="1" /> 13 <Option compiler="gcc" /> 14 <Compiler> 15 <Add option="-g" /> 16 <Add option="-DERR_DEBUG" /> 17 <Add option="-DMEM_DEBUG" /> 18 </Compiler> 19 <Linker> 20 <Add library="C:/MinGW/allegro/lib/liballegro_acodec-debug-static.a" /> 21 <Add library="C:/MinGW/allegro/lib/liballegro_audio-debug-static.a" /> 22 <Add library="C:/MinGW/allegro/lib/liballegro_color-debug-static.a" /> 23 <Add library="C:/MinGW/allegro/lib/liballegro_dialog-debug-static.a" /> 24 <Add library="C:/MinGW/allegro/lib/liballegro_font-debug-static.a" /> 25 <Add library="C:/MinGW/allegro/lib/liballegro_image-debug-static.a" /> 26 <Add library="C:/MinGW/allegro/lib/liballegro_main-debug-static.a" /> 27 <Add library="C:/MinGW/allegro/lib/liballegro_memfile-debug-static.a" /> 28 <Add library="C:/MinGW/allegro/lib/liballegro_monolith-debug-static.a" /> 29 <Add library="C:/MinGW/allegro/lib/liballegro_physfs-debug-static.a" /> 30 <Add library="C:/MinGW/allegro/lib/liballegro_primitives-debug-static.a" /> 31 <Add library="C:/MinGW/allegro/lib/liballegro_ttf-debug-static.a" /> 32 <Add library="C:/MinGW/allegro/lib/liballegro_video-debug-static.a" /> 33 <Add library="C:/MinGW/allegro/lib/liballegro-debug-static.a" /> 34 <Add library="C:/MinGW/lib/libgdiplus.a" /> 35 <Add library="C:/MinGW/lib/libuuid.a" /> 36 <Add library="C:/MinGW/lib/libkernel32.a" /> 37 <Add library="C:/MinGW/lib/libwinmm.a" /> 38 <Add library="C:/MinGW/lib/libpsapi.a" /> 39 <Add library="C:/MinGW/lib/libopengl32.a" /> 40 <Add library="C:/MinGW/lib/libglu32.a" /> 41 <Add library="C:/MinGW/lib/libuser32.a" /> 42 <Add library="C:/MinGW/lib/libcomdlg32.a" /> 43 <Add library="C:/MinGW/lib/libgdi32.a" /> 44 <Add library="C:/MinGW/lib/libshell32.a" /> 45 <Add library="C:/MinGW/lib/libole32.a" /> 46 <Add library="C:/MinGW/lib/libadvapi32.a" /> 47 <Add library="C:/MinGW/lib/libws2_32.a" /> 48 <Add library="C:/MinGW/lib/libshlwapi.a" /> 49 <Add library="C:/MinGW/allegro_deps/lib/libdumb.a" /> 50 <Add library="C:/MinGW/allegro_deps/lib/libFLAC.a" /> 51 <Add library="C:/MinGW/allegro_deps/lib/libfreetype.a" /> 52 <Add library="C:/MinGW/allegro_deps/lib/libjpeg.a" /> 53 <Add library="C:/MinGW/allegro_deps/lib/libogg.a" /> 54 <Add library="C:/MinGW/allegro_deps/lib/libopus.a" /> 55 <Add library="C:/MinGW/allegro_deps/lib/libopusfile.a" /> 56 <Add library="C:/MinGW/allegro_deps/lib/libphysfs.a" /> 57 <Add library="C:/MinGW/allegro_deps/lib/libpng16.a" /> 58 <Add library="C:/MinGW/allegro_deps/lib/libtheoradec.a" /> 59 <Add library="C:/MinGW/allegro_deps/lib/libvorbis.a" /> 60 <Add library="C:/MinGW/allegro_deps/lib/libvorbisfile.a" /> 61 <Add library="C:/MinGW/allegro_deps/lib/libzlib.a" /> 62 </Linker> 63 </Target> 64 <Target title="Release"> 65 <Option output="bin/Crucis" prefix_auto="1" extension_auto="1" /> 66 <Option object_output="obj/" /> 67 <Option type="1" /> 68 <Option compiler="gcc" /> 69 <Compiler> 70 <Add option="-O2" /> 71 </Compiler> 72 <Linker> 73 <Add option="-s" /> 74 <Add library="C:/MinGW/allegro/lib/liballegro_acodec-static.a" /> 75 <Add library="C:/MinGW/allegro/lib/liballegro_audio-static.a" /> 76 <Add library="C:/MinGW/allegro/lib/liballegro_color-static.a" /> 77 <Add library="C:/MinGW/allegro/lib/liballegro_dialog-static.a" /> 78 <Add library="C:/MinGW/allegro/lib/liballegro_font-static.a" /> 79 <Add library="C:/MinGW/allegro/lib/liballegro_image-static.a" /> 80 <Add library="C:/MinGW/allegro/lib/liballegro_main-static.a" /> 81 <Add library="C:/MinGW/allegro/lib/liballegro_memfile-static.a" /> 82 <Add library="C:/MinGW/allegro/lib/liballegro_monolith-static.a" /> 83 <Add library="C:/MinGW/allegro/lib/liballegro_physfs-static.a" /> 84 <Add library="C:/MinGW/allegro/lib/liballegro_primitives-static.a" /> 85 <Add library="C:/MinGW/allegro/lib/liballegro_ttf-static.a" /> 86 <Add library="C:/MinGW/allegro/lib/liballegro_video-static.a" /> 87 <Add library="C:/MinGW/allegro/lib/liballegro-static.a" /> 88 <Add library="C:/MinGW/lib/libgdiplus.a" /> 89 <Add library="C:/MinGW/lib/libuuid.a" /> 90 <Add library="C:/MinGW/lib/libkernel32.a" /> 91 <Add library="C:/MinGW/lib/libwinmm.a" /> 92 <Add library="C:/MinGW/lib/libpsapi.a" /> 93 <Add library="C:/MinGW/lib/libopengl32.a" /> 94 <Add library="C:/MinGW/lib/libglu32.a" /> 95 <Add library="C:/MinGW/lib/libuser32.a" /> 96 <Add library="C:/MinGW/lib/libcomdlg32.a" /> 97 <Add library="C:/MinGW/lib/libgdi32.a" /> 98 <Add library="C:/MinGW/lib/libshell32.a" /> 99 <Add library="C:/MinGW/lib/libole32.a" /> 100 <Add library="C:/MinGW/lib/libadvapi32.a" /> 101 <Add library="C:/MinGW/lib/libws2_32.a" /> 102 <Add library="C:/MinGW/lib/libshlwapi.a" /> 103 <Add library="C:/MinGW/allegro_deps/lib/libdumb.a" /> 104 <Add library="C:/MinGW/allegro_deps/lib/libFLAC.a" /> 105 <Add library="C:/MinGW/allegro_deps/lib/libfreetype.a" /> 106 <Add library="C:/MinGW/allegro_deps/lib/libjpeg.a" /> 107 <Add library="C:/MinGW/allegro_deps/lib/libogg.a" /> 108 <Add library="C:/MinGW/allegro_deps/lib/libopus.a" /> 109 <Add library="C:/MinGW/allegro_deps/lib/libopusfile.a" /> 110 <Add library="C:/MinGW/allegro_deps/lib/libphysfs.a" /> 111 <Add library="C:/MinGW/allegro_deps/lib/libpng16.a" /> 112 <Add library="C:/MinGW/allegro_deps/lib/libtheoradec.a" /> 113 <Add library="C:/MinGW/allegro_deps/lib/libvorbis.a" /> 114 <Add library="C:/MinGW/allegro_deps/lib/libvorbisfile.a" /> 115 <Add library="C:/MinGW/allegro_deps/lib/libzlib.a" /> 116 </Linker> 117 </Target> 118 </Build> 119 <Compiler> 120 <Add option="-Weffc++" /> 121 <Add option="-pedantic" /> 122 <Add option="-Wfatal-errors" /> 123 <Add option="-Wextra" /> 124 <Add option="-Wall" /> 125 <Add option="-std=c11" /> 126 <Add option="-DALLEGRO_STATICLINK" /> 127 <Add directory="C:/Users/Platino/Documents/C/Crucis/include" /> 128 <Add directory="C:/Users/Platino/Documents/C/Crucis/lib" /> 129 <Add directory="C:/MinGW/allegro/include" /> 130 <Add directory="C:/MinGW/allegro_deps/include" /> 131 </Compiler> 132 <Linker> 133 <Add option="-static" /> 134 <Add option="-static-libgcc" /> 135 </Linker> 136 <Unit filename="include/animation.h" /> 137 <Unit filename="include/camera.h" /> 138 <Unit filename="include/factory.h" /> 139 <Unit filename="include/game.h" /> 140 <Unit filename="include/input.h" /> 141 <Unit filename="include/level.h" /> 142 <Unit filename="include/mail.h" /> 143 <Unit filename="include/part.h" /> 144 <Unit filename="include/part/anim.h" /> 145 <Unit filename="include/part/brain.h" /> 146 <Unit filename="include/part/image.h" /> 147 <Unit filename="include/part/player.h" /> 148 <Unit filename="include/part/pos.h" /> 149 <Unit filename="include/render.h" /> 150 <Unit filename="include/sprite.h" /> 151 <Unit filename="include/texture.h" /> 152 <Unit filename="include/tile.h" /> 153 <Unit filename="include/turn.h" /> 154 <Unit filename="include/type.h" /> 155 <Unit filename="include/window.h" /> 156 <Unit filename="lib/eps.c"> 157 <Option compilerVar="CC" /> 158 </Unit> 159 <Unit filename="lib/eps.h" /> 160 <Unit filename="lib/posbox.c"> 161 <Option compilerVar="CC" /> 162 </Unit> 163 <Unit filename="lib/posbox.h" /> 164 <Unit filename="lib/rng.c"> 165 <Option compilerVar="CC" /> 166 </Unit> 167 <Unit filename="lib/rng.h" /> 168 <Unit filename="lib/salloc.c"> 169 <Option compilerVar="CC" /> 170 </Unit> 171 <Unit filename="lib/salloc.h" /> 172 <Unit filename="lib/sonparse.c"> 173 <Option compilerVar="CC" /> 174 </Unit> 175 <Unit filename="lib/sonparse.h" /> 176 <Unit filename="lib/vassert.c"> 177 <Option compilerVar="CC" /> 178 </Unit> 179 <Unit filename="lib/vassert.h" /> 180 <Unit filename="src/animation.c"> 181 <Option compilerVar="CC" /> 182 </Unit> 183 <Unit filename="src/camera.c"> 184 <Option compilerVar="CC" /> 185 </Unit> 186 <Unit filename="src/factory.c"> 187 <Option compilerVar="CC" /> 188 </Unit> 189 <Unit filename="src/game.c"> 190 <Option compilerVar="CC" /> 191 </Unit> 192 <Unit filename="src/input.c"> 193 <Option compilerVar="CC" /> 194 </Unit> 195 <Unit filename="src/level.c"> 196 <Option compilerVar="CC" /> 197 </Unit> 198 <Unit filename="src/mail.c"> 199 <Option compilerVar="CC" /> 200 </Unit> 201 <Unit filename="src/main.c"> 202 <Option compilerVar="CC" /> 203 </Unit> 204 <Unit filename="src/part.c"> 205 <Option compilerVar="CC" /> 206 </Unit> 207 <Unit filename="src/part/anim.c"> 208 <Option compilerVar="CC" /> 209 </Unit> 210 <Unit filename="src/part/brain.c"> 211 <Option compilerVar="CC" /> 212 </Unit> 213 <Unit filename="src/part/image.c"> 214 <Option compilerVar="CC" /> 215 </Unit> 216 <Unit filename="src/part/player.c"> 217 <Option compilerVar="CC" /> 218 </Unit> 219 <Unit filename="src/part/pos.c"> 220 <Option compilerVar="CC" /> 221 </Unit> 222 <Unit filename="src/render.c"> 223 <Option compilerVar="CC" /> 224 </Unit> 225 <Unit filename="src/sprite.c"> 226 <Option compilerVar="CC" /> 227 </Unit> 228 <Unit filename="src/texture.c"> 229 <Option compilerVar="CC" /> 230 </Unit> 231 <Unit filename="src/tile.c"> 232 <Option compilerVar="CC" /> 233 </Unit> 234 <Unit filename="src/turn.c"> 235 <Option compilerVar="CC" /> 236 </Unit> 237 <Unit filename="src/window.c"> 238 <Option compilerVar="CC" /> 239 </Unit> 240 <Extensions> 241 <code_completion /> 242 <envvars /> 243 <debugger /> 244 <lib_finder disable_auto="1" /> 245 </Extensions> 246 </Project> 247</CodeBlocks_project_file>

And here are the errors I'm getting:

#SelectExpand
1||=== Build: Release in Crucis (compiler: GNU GCC Compiler) ===| 2obj\src\input.o:input.c|| undefined reference to `al_get_keyboard_state'| 3obj\src\input.o:input.c|| undefined reference to `al_key_down'| 4obj\src\input.o:input.c|| undefined reference to `al_key_down'| 5obj\src\input.o:input.c|| undefined reference to `al_key_down'| 6obj\src\input.o:input.c|| undefined reference to `al_key_down'| 7obj\src\sprite.o:sprite.c|| undefined reference to `al_draw_bitmap_region'| 8obj\src\texture.o:texture.c|| undefined reference to `al_load_bitmap'| 9obj\src\texture.o:texture.c|| undefined reference to `al_destroy_bitmap'| 10obj\src\tile.o:tile.c|| undefined reference to `al_map_rgb'| 11obj\src\tile.o:tile.c|| undefined reference to `al_draw_prim'| 12obj\src\window.o:window.c|| undefined reference to `al_install_system'| 13obj\src\window.o:window.c|| undefined reference to `al_init_image_addon'| 14obj\src\window.o:window.c|| undefined reference to `al_init_primitives_addon'| 15obj\src\window.o:window.c|| undefined reference to `al_install_keyboard'| 16obj\src\window.o:window.c|| undefined reference to `al_set_new_display_flags'| 17obj\src\window.o:window.c|| undefined reference to `al_set_new_display_option'| 18obj\src\window.o:window.c|| undefined reference to `al_get_num_display_modes'| 19obj\src\window.o:window.c|| undefined reference to `al_get_display_mode'| 20obj\src\window.o:window.c|| undefined reference to `al_create_display'| 21obj\src\window.o:window.c|| undefined reference to `al_create_event_queue'| 22obj\src\window.o:window.c|| undefined reference to `al_get_display_event_source'| 23obj\src\window.o:window.c|| undefined reference to `al_register_event_source'| 24obj\src\window.o:window.c|| undefined reference to `al_get_keyboard_event_source'| 25obj\src\window.o:window.c|| undefined reference to `al_register_event_source'| 26obj\src\window.o:window.c|| undefined reference to `al_map_rgb'| 27obj\src\window.o:window.c|| undefined reference to `al_destroy_bitmap'| 28obj\src\window.o:window.c|| undefined reference to `al_get_display_height'| 29obj\src\window.o:window.c|| undefined reference to `al_get_display_width'| 30obj\src\window.o:window.c|| undefined reference to `al_create_bitmap'| 31obj\src\window.o:window.c|| undefined reference to `al_destroy_bitmap'| 32obj\src\window.o:window.c|| undefined reference to `al_destroy_display'| 33obj\src\window.o:window.c|| undefined reference to `al_destroy_event_queue'| 34obj\src\window.o:window.c|| undefined reference to `al_set_target_backbuffer'| 35obj\src\window.o:window.c|| undefined reference to `al_get_display_height'| 36obj\src\window.o:window.c|| undefined reference to `al_get_display_width'| 37obj\src\window.o:window.c|| undefined reference to `al_get_bitmap_height'| 38obj\src\window.o:window.c|| undefined reference to `al_get_bitmap_width'| 39obj\src\window.o:window.c|| undefined reference to `al_draw_scaled_bitmap'| 40obj\src\window.o:window.c|| undefined reference to `al_flip_display'| 41obj\src\window.o:window.c|| undefined reference to `al_clear_to_color'| 42obj\src\window.o:window.c|| undefined reference to `al_set_target_bitmap'| 43obj\src\window.o:window.c|| undefined reference to `al_clear_to_color'| 44obj\src\window.o:window.c|| undefined reference to `al_get_next_event'| 45obj\src\window.o:window.c|| undefined reference to `al_get_bitmap_width'| 46obj\src\window.o:window.c|| undefined reference to `al_get_bitmap_height'| 47obj\src\window.o:window.c|| undefined reference to `al_uninstall_system'| 48||error: ld returned 1 exit status| 49||=== Build failed: 47 error(s), 0 warning(s) (0 minute(s), 3 second(s)) ===|

Edgar Reynaldo
Quote:

 <Add library="C:/MinGW/allegro/lib/liballegro_monolith-debug-static.a" />

This is the only allegro library that you really need to link. For some reason, the linker is not linking correctly to the allegro libraries. It could be because of ordering problems. You should link the windows libraries last, after the dependencies, and link the dependencies after allegro.

DragonDePlatino

So my link order should look like this?

#SelectExpand
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 2<CodeBlocks_project_file> 3 <FileVersion major="1" minor="6" /> 4 <Project> 5 <Option title="Crucis" /> 6 <Option pch_mode="2" /> 7 <Option compiler="gcc" /> 8 <Build> 9 <Target title="Debug"> 10 <Option output="bin-debug/Crucis" prefix_auto="1" extension_auto="1" /> 11 <Option object_output="obj-debug/" /> 12 <Option type="1" /> 13 <Option compiler="gcc" /> 14 <Compiler> 15 <Add option="-g" /> 16 <Add option="-DERR_DEBUG" /> 17 <Add option="-DMEM_DEBUG" /> 18 </Compiler> 19 <Linker> 20 <Add library="C:/MinGW/allegro/lib/liballegro_monolith-debug-static.a" /> 21 <Add library="C:/MinGW/allegro_deps/lib/libdumb.a" /> 22 <Add library="C:/MinGW/allegro_deps/lib/libFLAC.a" /> 23 <Add library="C:/MinGW/allegro_deps/lib/libfreetype.a" /> 24 <Add library="C:/MinGW/allegro_deps/lib/libjpeg.a" /> 25 <Add library="C:/MinGW/allegro_deps/lib/libogg.a" /> 26 <Add library="C:/MinGW/allegro_deps/lib/libopus.a" /> 27 <Add library="C:/MinGW/allegro_deps/lib/libopusfile.a" /> 28 <Add library="C:/MinGW/allegro_deps/lib/libphysfs.a" /> 29 <Add library="C:/MinGW/allegro_deps/lib/libpng16.a" /> 30 <Add library="C:/MinGW/allegro_deps/lib/libtheoradec.a" /> 31 <Add library="C:/MinGW/allegro_deps/lib/libvorbis.a" /> 32 <Add library="C:/MinGW/allegro_deps/lib/libvorbisfile.a" /> 33 <Add library="C:/MinGW/allegro_deps/lib/libzlib.a" /> 34 <Add library="C:/MinGW/lib/libgdiplus.a" /> 35 <Add library="C:/MinGW/lib/libuuid.a" /> 36 <Add library="C:/MinGW/lib/libkernel32.a" /> 37 <Add library="C:/MinGW/lib/libwinmm.a" /> 38 <Add library="C:/MinGW/lib/libpsapi.a" /> 39 <Add library="C:/MinGW/lib/libopengl32.a" /> 40 <Add library="C:/MinGW/lib/libglu32.a" /> 41 <Add library="C:/MinGW/lib/libuser32.a" /> 42 <Add library="C:/MinGW/lib/libcomdlg32.a" /> 43 <Add library="C:/MinGW/lib/libgdi32.a" /> 44 <Add library="C:/MinGW/lib/libshell32.a" /> 45 <Add library="C:/MinGW/lib/libole32.a" /> 46 <Add library="C:/MinGW/lib/libadvapi32.a" /> 47 <Add library="C:/MinGW/lib/libws2_32.a" /> 48 <Add library="C:/MinGW/lib/libshlwapi.a" /> 49 </Linker> 50 </Target> 51 <Target title="Release"> 52 <Option output="bin/Crucis" prefix_auto="1" extension_auto="1" /> 53 <Option object_output="obj/" /> 54 <Option type="1" /> 55 <Option compiler="gcc" /> 56 <Compiler> 57 <Add option="-O2" /> 58 </Compiler> 59 <Linker> 60 <Add option="-s" /> 61 <Add library="C:/MinGW/allegro/lib/liballegro_monolith-static.a" /> 62 <Add library="C:/MinGW/allegro_deps/lib/libdumb.a" /> 63 <Add library="C:/MinGW/allegro_deps/lib/libFLAC.a" /> 64 <Add library="C:/MinGW/allegro_deps/lib/libfreetype.a" /> 65 <Add library="C:/MinGW/allegro_deps/lib/libjpeg.a" /> 66 <Add library="C:/MinGW/allegro_deps/lib/libogg.a" /> 67 <Add library="C:/MinGW/allegro_deps/lib/libopus.a" /> 68 <Add library="C:/MinGW/allegro_deps/lib/libopusfile.a" /> 69 <Add library="C:/MinGW/allegro_deps/lib/libphysfs.a" /> 70 <Add library="C:/MinGW/allegro_deps/lib/libpng16.a" /> 71 <Add library="C:/MinGW/allegro_deps/lib/libtheoradec.a" /> 72 <Add library="C:/MinGW/allegro_deps/lib/libvorbis.a" /> 73 <Add library="C:/MinGW/allegro_deps/lib/libvorbisfile.a" /> 74 <Add library="C:/MinGW/allegro_deps/lib/libzlib.a" /> 75 <Add library="C:/MinGW/lib/libgdiplus.a" /> 76 <Add library="C:/MinGW/lib/libuuid.a" /> 77 <Add library="C:/MinGW/lib/libkernel32.a" /> 78 <Add library="C:/MinGW/lib/libwinmm.a" /> 79 <Add library="C:/MinGW/lib/libpsapi.a" /> 80 <Add library="C:/MinGW/lib/libopengl32.a" /> 81 <Add library="C:/MinGW/lib/libglu32.a" /> 82 <Add library="C:/MinGW/lib/libuser32.a" /> 83 <Add library="C:/MinGW/lib/libcomdlg32.a" /> 84 <Add library="C:/MinGW/lib/libgdi32.a" /> 85 <Add library="C:/MinGW/lib/libshell32.a" /> 86 <Add library="C:/MinGW/lib/libole32.a" /> 87 <Add library="C:/MinGW/lib/libadvapi32.a" /> 88 <Add library="C:/MinGW/lib/libws2_32.a" /> 89 <Add library="C:/MinGW/lib/libshlwapi.a" /> 90 </Linker> 91 </Target> 92 </Build> 93 <Compiler> 94 <Add option="-Weffc++" /> 95 <Add option="-pedantic" /> 96 <Add option="-Wfatal-errors" /> 97 <Add option="-Wextra" /> 98 <Add option="-Wall" /> 99 <Add option="-std=c11" /> 100 <Add option="-DALLEGRO_STATICLINK" /> 101 <Add directory="C:/Users/Platino/Documents/C/Crucis/include" /> 102 <Add directory="C:/Users/Platino/Documents/C/Crucis/lib" /> 103 <Add directory="C:/MinGW/allegro/include" /> 104 <Add directory="C:/MinGW/allegro_deps/include" /> 105 </Compiler> 106 <Linker> 107 <Add option="-static" /> 108 <Add option="-static-libgcc" /> 109 </Linker> 110 <Unit filename="include/animation.h" /> 111 <Unit filename="include/camera.h" /> 112 <Unit filename="include/factory.h" /> 113 <Unit filename="include/game.h" /> 114 <Unit filename="include/input.h" /> 115 <Unit filename="include/level.h" /> 116 <Unit filename="include/mail.h" /> 117 <Unit filename="include/part.h" /> 118 <Unit filename="include/part/anim.h" /> 119 <Unit filename="include/part/brain.h" /> 120 <Unit filename="include/part/image.h" /> 121 <Unit filename="include/part/player.h" /> 122 <Unit filename="include/part/pos.h" /> 123 <Unit filename="include/render.h" /> 124 <Unit filename="include/sprite.h" /> 125 <Unit filename="include/texture.h" /> 126 <Unit filename="include/tile.h" /> 127 <Unit filename="include/turn.h" /> 128 <Unit filename="include/type.h" /> 129 <Unit filename="include/window.h" /> 130 <Unit filename="lib/eps.c"> 131 <Option compilerVar="CC" /> 132 </Unit> 133 <Unit filename="lib/eps.h" /> 134 <Unit filename="lib/posbox.c"> 135 <Option compilerVar="CC" /> 136 </Unit> 137 <Unit filename="lib/posbox.h" /> 138 <Unit filename="lib/rng.c"> 139 <Option compilerVar="CC" /> 140 </Unit> 141 <Unit filename="lib/rng.h" /> 142 <Unit filename="lib/salloc.c"> 143 <Option compilerVar="CC" /> 144 </Unit> 145 <Unit filename="lib/salloc.h" /> 146 <Unit filename="lib/sonparse.c"> 147 <Option compilerVar="CC" /> 148 </Unit> 149 <Unit filename="lib/sonparse.h" /> 150 <Unit filename="lib/vassert.c"> 151 <Option compilerVar="CC" /> 152 </Unit> 153 <Unit filename="lib/vassert.h" /> 154 <Unit filename="src/animation.c"> 155 <Option compilerVar="CC" /> 156 </Unit> 157 <Unit filename="src/camera.c"> 158 <Option compilerVar="CC" /> 159 </Unit> 160 <Unit filename="src/factory.c"> 161 <Option compilerVar="CC" /> 162 </Unit> 163 <Unit filename="src/game.c"> 164 <Option compilerVar="CC" /> 165 </Unit> 166 <Unit filename="src/input.c"> 167 <Option compilerVar="CC" /> 168 </Unit> 169 <Unit filename="src/level.c"> 170 <Option compilerVar="CC" /> 171 </Unit> 172 <Unit filename="src/mail.c"> 173 <Option compilerVar="CC" /> 174 </Unit> 175 <Unit filename="src/main.c"> 176 <Option compilerVar="CC" /> 177 </Unit> 178 <Unit filename="src/part.c"> 179 <Option compilerVar="CC" /> 180 </Unit> 181 <Unit filename="src/part/anim.c"> 182 <Option compilerVar="CC" /> 183 </Unit> 184 <Unit filename="src/part/brain.c"> 185 <Option compilerVar="CC" /> 186 </Unit> 187 <Unit filename="src/part/image.c"> 188 <Option compilerVar="CC" /> 189 </Unit> 190 <Unit filename="src/part/player.c"> 191 <Option compilerVar="CC" /> 192 </Unit> 193 <Unit filename="src/part/pos.c"> 194 <Option compilerVar="CC" /> 195 </Unit> 196 <Unit filename="src/render.c"> 197 <Option compilerVar="CC" /> 198 </Unit> 199 <Unit filename="src/sprite.c"> 200 <Option compilerVar="CC" /> 201 </Unit> 202 <Unit filename="src/texture.c"> 203 <Option compilerVar="CC" /> 204 </Unit> 205 <Unit filename="src/tile.c"> 206 <Option compilerVar="CC" /> 207 </Unit> 208 <Unit filename="src/turn.c"> 209 <Option compilerVar="CC" /> 210 </Unit> 211 <Unit filename="src/window.c"> 212 <Option compilerVar="CC" /> 213 </Unit> 214 <Extensions> 215 <code_completion /> 216 <envvars /> 217 <debugger /> 218 <lib_finder disable_auto="1" /> 219 </Extensions> 220 </Project> 221</CodeBlocks_project_file>

I'm still getting the same result. 47 errors, all pointing to undefined references.

Ian Lewis

I went through similar problems, but with 32-bit windows 7. There's a thread here:

https://www.allegro.cc/forums/thread/616089

The obvious differences between your setup and mine are that I seemed to need a couple of extra switches in the linker settings. Specifically

-static-libstdc++
-lpthread

Don't know if that will help you or not!

Edgar Reynaldo

Post your build log. For some reason it's not linking.

You can try adding the libraries to linker options instead of link libraries. Specify libNAME.a with -lNAME in the linker options.

DragonDePlatino

I tried a few more things and it turned out to be an issue with my compiler. If you use CodeBlocks with MinGW pre-installed, it will not properly link. And if you use the official mingw-get, you can't compile at all due to faulty installation via a SourceForge error.

The solution was to use TDM-GCC which gave me some annoying messages about the _FUNCTION_ macro but at least it compiles. On one last note, does anyone have a reccomendation of other simple C compilers compatible with CodeBlocks?

Edgar Reynaldo

Allegro and its dependencies need to be compiled with the same compiler you're using to compile your program. Otherwise you can get some (not so) subtle bugs if not outright incompatibilities. I'm surprised your program compiled if you're using TDM-GCC for your program and the MSYS2 MinGW binaries for allegro and its dependencies. You might consider compiling it yourself, but the dependencies take a while to get right.

If mingw-get is not working, you should file a bug report with the mingwuser mailing list.

I may put out binaries for MinGW 5.3.0 and Allegro 5.2.2 here in a week or three. I need to sort out some issues with D3D and make a new release for my MinGW binaries first.

Thread #616704. Printed from Allegro.cc