Allegro 4.4.3 fail compile MinGW W10

  allegro4, c++, mingw-w64

i’m newbie at this, I am trying to follow some retro game programing tutorials in C++ with Allegro library, but i can´t get it works.

At this point, I have this:

-MinGW-w64 i686-8.1.0-release-posix-dwarf-rt_v6-rev0, gcc 8.1 compiler

-Allegro 4.4.3 binary package (makes with the same compiler, gcc 8.1)

C:MinGW32mingw32bin include in PATH

I put the library files in their corresponding MingW folders like tutorial says:

allegro: bin include lib to mingw32:bin include lib

But, when i try compile a test code with:

g++ -I"C:MinGW32mingw32include" -L"C:MinGW32mingw32lib" -lalleg -o test.exe test.cpp

I recieve

C:Users...cce6N8JY.o:test.cpp:(.text+0x4d): undefined reference to `_install_allegro_version_check'
C:Users...cce6N8JY.o:test.cpp:(.text+0x52): undefined reference to `install_keyboard'
C:Users...cce6N8JY.o:test.cpp:(.text+0x5e): undefined reference to `set_color_depth'
C:Users...cce6N8JY.o:test.cpp:(.text+0x8a): undefined reference to `set_gfx_mode'
C:Users...cce6N8JY.o:test.cpp:(.text+0xa6): undefined reference to `install_sound'
C:Users...cce6N8JY.o:test.cpp:(.text+0xb4): undefined reference to `_imp__allegro_error'
C:Users...cce6N8JY.o:test.cpp:(.text+0xc4): undefined reference to `allegro_message'
C:Users...cce6N8JY.o:test.cpp:(.text+0xe2): undefined reference to `set_volume'
C:Users...cce6N8JY.o:test.cpp:(.text+0xf6): undefined reference to `create_bitmap'
C:Users...cce6N8JY.o:test.cpp:(.text+0x111): undefined reference to `_imp__font'
C:Users...cce6N8JY.o:test.cpp:(.text+0x14a): undefined reference to `textout_centre_ex'
C:Users...cce6N8JY.o:test.cpp:(.text+0x14f): undefined reference to `_imp__screen'
C:Users...cce6N8JY.o:test.cpp:(.text+0x190): undefined reference to `blit'
C:Users...cce6N8JY.o:test.cpp:(.text+0x195): undefined reference to `readkey'
C:Users...cce6N8JY.o:test.cpp:(.text+0x1a0): undefined reference to `destroy_bitmap'
C:Users...cce6N8JY.o:test.cpp:(.text+0x1d5): undefined reference to `_WinMain'
collect2.exe: error: ld returned 1 exit status

looks like include files aren´t in their correspondet folder, but yes are.
Thanks in advance

Source: Windows Questions C++

LEAVE A COMMENT