Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Installing 5.2 mingw Code::Blocks

This thread is locked; no one can reply to it. rss feed Print
Installing 5.2 mingw Code::Blocks
Yodhe23
Member #8,726
June 2007

I am getting the (traditional) "undefined reference" from improperly linking the allegro library in Code::blocks.
I have installed gcc 4.9.3 and the 5.2 x64 mingw binaries from the liballeg.org, yet none of libraries (.a) in the lib folder seem to work with even a basic example. Am I using the wrong gcc version?
Thanks

www.justanotherturn.com

SiegeLord
Member #7,827
October 2006
avatar

What is the exact error?

That said, those binaries are 'designed' for GCC 5.3.0 that comes with mingw-w64.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Yodhe23
Member #8,726
June 2007

You know undefined reference to everything with "al_" infront of the function, such as undefined reference to al_install_system", which means that the library isn't being linked in the linker options dialog in Code::Blocks compiler options.

I followed the install instructions from liballeg, which still take you to the "mingw installer" and which installs gcc 4.9.3, rather than 5.3.0. So after installing mingw-w64 (i didn't know there was a difference between mingw and mingw-w64), I opened a shell/command line and then used this command to update gcc to 5.3

pacman --noconfirm -Suy python2 make pkg-config mingw-w64-x86_64-glib2 mingw-w64-x86_64-toolchain

I now have gcc 5.3.0 installed in c:\msys64/mingw64, and after changing my windows paths to point to this directory from my the c:\MinGW installed by the MinGW installer, I have success. (I had to drop the appropriate .dll I was using into the same folder as the .exe to get it work, but I think that due to a lack of a PATH variable).

Anyway I am happy after porting my game to windows from linux, with 0 changes in my code. It worked straight across. ;D

Now I can concentrate getting it onto steam greenlight so I can my fellow allegronauts feedback.

(Also there is an error in the building from source instruction, which say use "C:\devel" except the makefile scripts are made for "C:\dev" in the a5_sourcepack and so throw up an error.)

www.justanotherturn.com

Mark Oates
Member #1,146
March 2001
avatar

Yodhe23 said:

Anyway I am happy after porting my game to windows from linux, with 0 changes in my code. It worked straight across. ;D

Niiiiice! 8-)

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Go to: