Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allegro 5.2.3 DirectX build errors

This thread is locked; no one can reply to it. rss feed Print
Allegro 5.2.3 DirectX build errors
BitCruncher
Member #11,279
August 2009

Windows 10
Compiler: mingw-w64 i686 7.2.0 posix dwarf

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:
C:/devel/dxsdk/Include/xinput.h:231:5: error: unknown type name '__in'; did you mean '__min'?
__in DWORD dwUserIndex, // Index of the gamer associated with the device
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:232:5: error: unknown type name '__out'
__out XINPUT_STATE* pState // Receives the current state
^~~~~
C:/devel/dxsdk/Include/xinput.h:237:5: error: unknown type name '__in'; did you mean '__min'?
__in DWORD dwUserIndex, // Index of the gamer associated with the device
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:238:5: error: unknown type name '__in'; did you mean '__min'?
__in XINPUT_VIBRATION* pVibration // The vibration information to send to the controller
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:243:5: error: unknown type name '__in'; did you mean '__min'?
__in DWORD dwUserIndex, // Index of the gamer associated with the device
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:244:5: error: unknown type name '__in'; did you mean '__min'?
__in DWORD dwFlags, // Input flags that identify the device type
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:245:5: error: unknown type name '__out'
__out XINPUT_CAPABILITIES* pCapabilities // Receives the capabilities
^~~~~
C:/devel/dxsdk/Include/xinput.h:250:5: error: unknown type name '__in'; did you mean '__min'?
__in BOOL enable // [in] Indicates whether xinput is enabled or disabled.
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:255:5: error: unknown type name '__in'; did you mean '__min'?
__in DWORD dwUserIndex, // Index of the gamer associated with the device
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:256:5: error: unknown type name '__out'
__out GUID* pDSoundRenderGuid, // DSound device ID for render
^~~~~
C:/devel/dxsdk/Include/xinput.h:257:5: error: unknown type name '__out'
__out GUID* pDSoundCaptureGuid // DSound device ID for capture
^~~~~
C:/devel/dxsdk/Include/xinput.h:264:5: error: unknown type name '__in'; did you mean '__min'?
__in DWORD dwUserIndex, // Index of the gamer associated with the device
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:265:5: error: unknown type name '__in'; did you mean '__min'?
__in BYTE devType, // Which device on this user index
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:266:5: error: unknown type name '__out'
__out XINPUT_BATTERY_INFORMATION* pBatteryInformation // Contains the level and types of batteries
^~~~~
C:/devel/dxsdk/Include/xinput.h:271:5: error: unknown type name '__in'; did you mean '__min'?
__in DWORD dwUserIndex, // Index of the gamer associated with the device
^~~~
__min
C:/devel/dxsdk/Include/xinput.h:272:5: error: unknown type name '__reserved'; did you mean 'SAL__reserved'?
__reserved DWORD dwReserved, // Reserved for future use
^~~~~~~~~~
SAL__reserved
C:/devel/dxsdk/Include/xinput.h:273:5: error: unknown type name '__out'
__out PXINPUT_KEYSTROKE pKeystroke // Pointer to an XINPUT_KEYSTROKE structure that receives an input event.
^~~~~
mingw32-make[2]: *** [CMakeFiles\allegro.dir\build.make:1488: CMakeFiles/allegro.dir/src/win/whapxi.c.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:67: CMakeFiles/allegro.dir/all] Error 2
mingw32-make: *** [Makefile:129: all] Error 2

SiegeLord
Member #7,827
October 2006
avatar

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
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

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,
from C:/mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/gcc/i686-w64-mingw32/7.2.0/include/c++/bits/basic_string.h:6159,
from C:/mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/gcc/i686-w64-mingw32/7.2.0/include/c++/string:52,
from C:/devel/allegro5/demos/cosmic_protector/include/cosmic_protector.hpp:15,
from C:\devel\allegro5\demos\cosmic_protector\src\Asteroid.cpp:1:
C:/mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/gcc/i686-w64-mingw32/7.2.0/include/c++/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.

Edgar Reynaldo
Member #8,592
May 2007
avatar

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
I'm not sure why you're getting errors with stdlib.h . Maybe try <cstdlib> ? It's compiling as C++, but that should still have no problem finding stdlib.h.

SiegeLord
Member #7,827
October 2006
avatar

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
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

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.
If it's monolithic, what else am I supposed to link?

#SelectExpand
1 2#include <allegro5/allegro.h> 3 4int main(int argc, char** argv) 5{ 6 al_init(); 7 return 0; 8}

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
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/myc build/Debug/MinGW-Windows/sources/main.o ../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wsystem.c.obj): In function `win_initialize':
C:/devel/allegro5/src/win/wsystem.c:196: undefined reference to `_imp__timeBeginPeriod@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wsystem.c.obj): In function `win_shutdown':
C:/devel/allegro5/src/win/wsystem.c:233: undefined reference to `_imp__timeEndPeriod@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wsystem.c.obj): In function `al_win_get_path':
C:/devel/allegro5/src/win/wsystem.c:605: undefined reference to `GetModuleFileNameExW@16'
C:/devel/allegro5/src/win/wsystem.c:637: undefined reference to `GetModuleFileNameExW@16'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wsystem.c.obj): In function `al_win_safe_load_library':
C:/devel/allegro5/src/win/wsystem.c:787: undefined reference to `_imp__PathFindOnPathA@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wtime.c.obj): In function `low_res_current_time':
C:/devel/allegro5/src/win/wtime.c:48: undefined reference to `_imp__timeGetTime@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wtime.c.obj): In function `al_win_init_time':
C:/devel/allegro5/src/win/wtime.c:101: undefined reference to `_imp__timeGetTime@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wtime.c.obj): In function `al_init_timeout':
C:/devel/allegro5/src/win/wtime.c:144: undefined reference to `_imp__timeGetTime@0'
C:/devel/allegro5/src/win/wtime.c:147: undefined reference to `_imp__timeGetTime@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wwindow.c.obj): In function `clear_window':
C:/devel/allegro5/src/win/wwindow.c:91: undefined reference to `_imp__GetStockObject@4'
C:/devel/allegro5/src/win/wwindow.c:91: undefined reference to `_imp__SelectObject@8'
C:/devel/allegro5/src/win/wwindow.c:92: undefined reference to `_imp__SetDCBrushColor@8'
C:/devel/allegro5/src/win/wwindow.c:94: undefined reference to `_imp__Rectangle@20'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wwindow.c.obj): In function `window_callback':
C:/devel/allegro5/src/win/wwindow.c:755: undefined reference to `_imp__CreateRectRgn@16'
C:/devel/allegro5/src/win/wwindow.c:764: undefined reference to `_imp__GetRegionData@12'
C:/devel/allegro5/src/win/wwindow.c:766: undefined reference to `_imp__GetRegionData@12'
C:/devel/allegro5/src/win/wwindow.c:786: undefined reference to `_imp__DeleteObject@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wxthread.c.obj): In function `al_cond_timedwait':
C:/devel/allegro5/src/win/wxthread.c:339: undefined reference to `_imp__timeGetTime@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `check_gl_error':
C:/devel/allegro5/src/opengl/ogl_shader.c:55: undefined reference to `_imp__glGetError@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `glsl_use_shader':
C:/devel/allegro5/src/opengl/ogl_shader.c:209: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_shader.c:211: undefined reference to `_imp__glGetError@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_shader.c.obj): In function `glsl_set_shader_sampler':
C:/devel/allegro5/src/opengl/ogl_shader.c:279: undefined reference to `_imp__glBindTexture@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `is_wgl_extension_supported':
C:/devel/allegro5/src/win/wgl_disp.c:103: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/win/wgl_disp.c:106: undefined reference to `_imp__wglGetProcAddress@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `init_temp_context':
C:/devel/allegro5/src/win/wgl_disp.c:135: undefined reference to `_imp__ChoosePixelFormat@8'
C:/devel/allegro5/src/win/wgl_disp.c:143: undefined reference to `_imp__SetPixelFormat@12'
C:/devel/allegro5/src/win/wgl_disp.c:149: undefined reference to `_imp__wglCreateContext@4'
C:/devel/allegro5/src/win/wgl_disp.c:156: undefined reference to `_imp__wglMakeCurrent@8'
C:/devel/allegro5/src/win/wgl_disp.c:159: undefined reference to `_imp__wglDeleteContext@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `init_pixel_format_extensions':
C:/devel/allegro5/src/win/wgl_disp.c:176: undefined reference to `_imp__wglGetProcAddress@4'
C:/devel/allegro5/src/win/wgl_disp.c:178: undefined reference to `_imp__wglGetProcAddress@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `init_context_creation_extensions':
C:/devel/allegro5/src/win/wgl_disp.c:194: undefined reference to `_imp__wglGetProcAddress@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `get_pixel_formats_count_old':
C:/devel/allegro5/src/win/wgl_disp.c:210: undefined reference to `_imp__DescribePixelFormat@16'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `read_pixel_format_old':
C:/devel/allegro5/src/win/wgl_disp.c:456: undefined reference to `_imp__DescribePixelFormat@16'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `init_ogl_context_ex':
C:/devel/allegro5/src/win/wgl_disp.c:670: undefined reference to `_imp__wglGetCurrentContext@0'
C:/devel/allegro5/src/win/wgl_disp.c:671: undefined reference to `_imp__wglGetCurrentDC@0'
C:/devel/allegro5/src/win/wgl_disp.c:694: undefined reference to `_imp__wglMakeCurrent@8'
C:/devel/allegro5/src/win/wgl_disp.c:696: undefined reference to `_imp__wglDeleteContext@4'
C:/devel/allegro5/src/win/wgl_disp.c:699: undefined reference to `_imp__wglMakeCurrent@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `get_available_pixel_formats_ext':
C:/devel/allegro5/src/win/wgl_disp.c:734: undefined reference to `_imp__wglGetCurrentContext@0'
C:/devel/allegro5/src/win/wgl_disp.c:735: undefined reference to `_imp__wglGetCurrentDC@0'
C:/devel/allegro5/src/win/wgl_disp.c:785: undefined reference to `_imp__wglMakeCurrent@8'
C:/devel/allegro5/src/win/wgl_disp.c:787: undefined reference to `_imp__wglDeleteContext@4'
C:/devel/allegro5/src/win/wgl_disp.c:790: undefined reference to `_imp__wglMakeCurrent@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `select_pixel_format':
C:/devel/allegro5/src/win/wgl_disp.c:884: undefined reference to `_imp__SetPixelFormat@12'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `create_display_internals':
C:/devel/allegro5/src/win/wgl_disp.c:975: undefined reference to `_imp__wglCreateContext@4'
C:/devel/allegro5/src/win/wgl_disp.c:986: undefined reference to `_imp__wglMakeCurrent@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `wgl_create_display':
C:/devel/allegro5/src/win/wgl_disp.c:1059: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/win/wgl_disp.c:1060: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/win/wgl_disp.c:1061: undefined reference to `_imp__glGetString@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `destroy_display_internals':
C:/devel/allegro5/src/win/wgl_disp.c:1104: undefined reference to `_imp__wglDeleteContext@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `wgl_set_current_display':
C:/devel/allegro5/src/win/wgl_disp.c:1158: undefined reference to `_imp__wglGetCurrentContext@0'
C:/devel/allegro5/src/win/wgl_disp.c:1162: undefined reference to `_imp__wglMakeCurrent@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `wgl_unset_current_display':
C:/devel/allegro5/src/win/wgl_disp.c:1181: undefined reference to `_imp__wglMakeCurrent@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `wgl_flip_display':
C:/devel/allegro5/src/win/wgl_disp.c:1337: undefined reference to `_imp__glFlush@0'
C:/devel/allegro5/src/win/wgl_disp.c:1339: undefined reference to `_imp__SwapBuffers@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wgl_disp.c.obj): In function `wgl_update_display_region':
C:/devel/allegro5/src/win/wgl_disp.c:1352: undefined reference to `_imp__glFlush@0'
C:/devel/allegro5/src/win/wgl_disp.c:1353: undefined reference to `_imp__SwapBuffers@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wmcursor.c.obj): In function `al_win_create_icon':
C:/devel/allegro5/src/win/wmcursor.c:97: undefined reference to `_imp__CreateCompatibleDC@4'
C:/devel/allegro5/src/win/wmcursor.c:98: undefined reference to `_imp__CreateCompatibleDC@4'
C:/devel/allegro5/src/win/wmcursor.c:101: undefined reference to `_imp__CreateBitmap@20'
C:/devel/allegro5/src/win/wmcursor.c:102: undefined reference to `_imp__CreateCompatibleBitmap@12'
C:/devel/allegro5/src/win/wmcursor.c:103: undefined reference to `_imp__SelectObject@8'
C:/devel/allegro5/src/win/wmcursor.c:104: undefined reference to `_imp__SelectObject@8'
C:/devel/allegro5/src/win/wmcursor.c:109: undefined reference to `_imp__SetPixel@16'
C:/devel/allegro5/src/win/wmcursor.c:110: undefined reference to `_imp__SetPixel@16'
C:/devel/allegro5/src/win/wmcursor.c:132: undefined reference to `_imp__SetPixel@16'
C:/devel/allegro5/src/win/wmcursor.c:136: undefined reference to `_imp__SetPixel@16'
C:/devel/allegro5/src/win/wmcursor.c:145: undefined reference to `_imp__SelectObject@8'
C:/devel/allegro5/src/win/wmcursor.c:146: undefined reference to `_imp__SelectObject@8'
C:/devel/allegro5/src/win/wmcursor.c:147: undefined reference to `_imp__DeleteDC@4'
C:/devel/allegro5/src/win/wmcursor.c:148: undefined reference to `_imp__DeleteDC@4'
C:/devel/allegro5/src/win/wmcursor.c:159: undefined reference to `_imp__DeleteObject@4'
C:/devel/allegro5/src/win/wmcursor.c:160: undefined reference to `_imp__DeleteObject@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wmcursor.c.obj): In function `local_stretch_blit_to_hdc':
C:/devel/allegro5/src/win/wmcursor.c:470: undefined reference to `_imp__StretchDIBits@52'
C:/devel/allegro5/src/win/wmcursor.c:475: undefined reference to `_imp__StretchDIBits@52'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wthread.c.obj): In function `al_win_thread_init':
C:/devel/allegro5/src/win/wthread.c:74: undefined reference to `_imp__CoInitialize@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(wthread.c.obj): In function `al_win_thread_exit':
C:/devel/allegro5/src/win/wthread.c:84: undefined reference to `_imp__CoUninitialize@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(extensions.c.obj): In function `al_ogl_version':
C:/devel/allegro5/src/opengl/extensions.c:150: undefined reference to `_imp__glGetString@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(extensions.c.obj): In function `print_extensions_3_0':
C:/devel/allegro5/src/opengl/extensions.c:212: undefined reference to `_imp__glGetIntegerv@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(extensions.c.obj): In function `load_extension':
C:/devel/allegro5/src/opengl/extensions.c:288: undefined reference to `_imp__wglGetProcAddress@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(extensions.c.obj): In function `ogl_is_extension_supported':
C:/devel/allegro5/src/opengl/extensions.c:476: undefined reference to `_imp__glGetIntegerv@8'
C:/devel/allegro5/src/opengl/extensions.c:488: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/opengl/extensions.c:502: undefined reference to `_imp__wglGetProcAddress@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(extensions.c.obj): In function `al_get_opengl_proc_address':
C:/devel/allegro5/src/opengl/extensions.c:613: undefined reference to `_imp__wglGetProcAddress@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(extensions.c.obj): In function `al_ogl_manage_extensions':
C:/devel/allegro5/src/opengl/extensions.c:733: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/opengl/extensions.c:790: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/opengl/extensions.c:839: undefined reference to `_imp__glGetIntegerv@8'
C:/devel/allegro5/src/opengl/extensions.c:868: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/opengl/extensions.c:879: undefined reference to `_imp__glGetString@4'
C:/devel/allegro5/src/opengl/extensions.c:889: undefined reference to `_imp__glGetIntegerv@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_bitmap.c.obj): In function `ogl_draw_bitmap_region':
C:/devel/allegro5/src/opengl/ogl_bitmap.c:351: undefined reference to `_imp__glBindTexture@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:352: undefined reference to `_imp__glCopyTexSubImage2D@32'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_bitmap.c.obj): In function `ogl_upload_bitmap':
C:/devel/allegro5/src/opengl/ogl_bitmap.c:404: undefined reference to `_imp__glGenTextures@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:405: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:416: undefined reference to `_imp__glBindTexture@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:417: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:425: undefined reference to `_imp__glTexParameteri@12'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:426: undefined reference to `_imp__glTexParameteri@12'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:432: undefined reference to `_imp__glTexParameteri@12'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:438: undefined reference to `_imp__glTexParameteri@12'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:460: undefined reference to `_imp__glTexParameteri@12'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:461: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:481: undefined reference to `_imp__glPixelStorei@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:482: undefined reference to `_imp__glTexImage2D@36'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:485: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:489: undefined reference to `_imp__glTexImage2D@36'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:493: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:515: undefined reference to `_imp__glDeleteTextures@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:524: undefined reference to `_imp__glGetError@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_bitmap.c.obj): In function `ogl_destroy_bitmap':
C:/devel/allegro5/src/opengl/ogl_bitmap.c:575: undefined reference to `_imp__glDeleteTextures@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_bitmap.c.obj): In function `ogl_lock_compressed_region':
C:/devel/allegro5/src/opengl/ogl_bitmap.c:769: undefined reference to `_imp__glPushClientAttrib@4'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:772: undefined reference to `_imp__glPixelStorei@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:773: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:785: undefined reference to `_imp__glBindTexture@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:787: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:830: undefined reference to `_imp__glPopClientAttrib@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_bitmap.c.obj): In function `ogl_unlock_compressed_region':
C:/devel/allegro5/src/opengl/ogl_bitmap.c:894: undefined reference to `_imp__glPushClientAttrib@4'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:897: undefined reference to `_imp__glPixelStorei@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:898: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:905: undefined reference to `_imp__glBindTexture@8'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:913: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_bitmap.c:920: undefined reference to `_imp__glPopClientAttrib@0'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_display.c.obj): In function `al_ogl_setup_bitmap_clipping':
C:/devel/allegro5/src/opengl/ogl_display.c:145: undefined reference to `_imp__glDisable@4'
C:/devel/allegro5/src/opengl/ogl_display.c:148: undefined reference to `_imp__glEnable@4'
C:/devel/allegro5/src/opengl/ogl_display.c:154: undefined reference to `_imp__glScissor@16'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `al_opengl_set_blender':
C:/devel/allegro5/src/opengl/ogl_draw.c:93: undefined reference to `_imp__glEnable@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:108: undefined reference to `_imp__glEnable@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:110: undefined reference to `_imp__glBlendFunc@8'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `vert_ptr_on':
C:/devel/allegro5/src/opengl/ogl_draw.c:137: undefined reference to `_imp__glEnableClientState@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:138: undefined reference to `_imp__glVertexPointer@16'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `vert_ptr_off':
C:/devel/allegro5/src/opengl/ogl_draw.c:152: undefined reference to `_imp__glDisableClientState@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `color_ptr_on':
C:/devel/allegro5/src/opengl/ogl_draw.c:167: undefined reference to `_imp__glEnableClientState@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:168: undefined reference to `_imp__glColorPointer@16'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `color_ptr_off':
C:/devel/allegro5/src/opengl/ogl_draw.c:182: undefined reference to `_imp__glDisableClientState@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `tex_ptr_on':
C:/devel/allegro5/src/opengl/ogl_draw.c:197: undefined reference to `_imp__glEnableClientState@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:198: undefined reference to `_imp__glTexCoordPointer@16'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `tex_ptr_off':
C:/devel/allegro5/src/opengl/ogl_draw.c:212: undefined reference to `_imp__glDisableClientState@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `ogl_clear_android_2_1_workaround':
C:/devel/allegro5/src/opengl/ogl_draw.c:253: undefined reference to `_imp__glDisableClientState@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:254: undefined reference to `_imp__glDisableClientState@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:257: undefined reference to `_imp__glDisable@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:258: undefined reference to `_imp__glBindTexture@8'
C:/devel/allegro5/src/opengl/ogl_draw.c:260: undefined reference to `_imp__glDrawArrays@12'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `ogl_clear':
C:/devel/allegro5/src/opengl/ogl_draw.c:296: undefined reference to `_imp__glClearColor@16'
C:/devel/allegro5/src/opengl/ogl_draw.c:297: undefined reference to `_imp__glClear@4'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `ogl_draw_pixel':
C:/devel/allegro5/src/opengl/ogl_draw.c:339: undefined reference to `_imp__glDrawArrays@12'
../../../../../mingw-w64/i686-7.2.0-posix-dwarf-rt_v5-rev1/mingw32/lib/liballegro_monolith-debug-static.a(ogl_draw.c.obj): In function `ogl_flush_vertex_cache':
C:/devel/allegro5/src/opengl/ogl_draw.c:390: undefined reference to `_imp__glEnable@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:393: undefined reference to `_imp__glGetIntegerv@8'
C:/devel/allegro5/src/opengl/ogl_draw.c:403: undefined reference to `_imp__glBindTexture@8'
C:/devel/allegro5/src/opengl/ogl_draw.c:459: undefined reference to `_imp__glDisableClientState@4'
C:/devel/allegro5/src/opengl/ogl_draw.c:462: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_draw.c:463: undefined reference to `_imp__glDrawArrays@12'
C:/devel/allegro5/src/opengl/ogl_draw.c:467: undefined reference to `_imp__glGetError@0'
C:/devel/allegro5/src/opengl/ogl_draw.c:502: undefined reference to `_imp__glDisable@4'

Edgar Reynaldo
Member #8,592
May 2007
avatar

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

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
Member #8,592
May 2007
avatar

SiegeLord
Member #7,827
October 2006
avatar

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
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

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
avatar

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
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

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
avatar

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
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

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
Member #8,592
May 2007
avatar

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.

Go to: