|
Allegro 4.4 from Macports on Mac OS X 10.6.8 with GCC 4.2.1 not compiling! HELP! |
i_am_a_mage
Member #16,796
January 2018
|
Trying to get this to compile by issuing the following command: gcc -Wall main.c -o main `pkg-config --cflags --libs allegro allegrogl`
but I get the following <a href="https://pastebin.com/4MTFL7DN>error</a>. Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10
Allegro: 4.4 installed from Macports for Snow Leopard |
Peter Hull
Member #1,136
March 2001
|
Quote: I figured it's a little too old No kidding! But, The error message seems fairly clear that you're compiling 64-bit and trying to link a 32-bit library (and an 'unknown' library for allegrogl.) Did you install the universal variant of allegro?, i.e. sudo port install allegro +universal I don't think allegrogl is needed in the example so try omitting it from the command line. If none of that works can you retry with -m32 and post the error message? Pete
|
i_am_a_mage
Member #16,796
January 2018
|
gcc -Wall main.c -o m -m32 `pkg-config --cflags --libs allegro` Undefined symbols: "_main", referenced from: start in crt1.10.6.o (maybe you meant: __mangled_main_address, __mangled_main ) ld: symbol(s) not found collect2: ld returned 1 exit status
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
gcc is picky about argument order. You need to separate the pkg-config calls into two separate calls, one for cflags, and one for libs gcc -Wall -Wextra -Wshadow -g -o proggie `pkg-config --cflags allegro5` main.c `pkg-config --libs allegro5` The --cflags argument has to come before your main.c, and the --libs argument has to go after it. It also looks like you need to link to allegro main (OSX thing). 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 |
i_am_a_mage
Member #16,796
January 2018
|
It finally compiled . Thanks Edgar for the tips . I tweaked what you said a bit. I uninstalled the version by Macports and installed the Allegro 4.4 by Fink. Then I finally typed the following command: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
yeah, sorry, I was in Allegro 5 mode. Allegro 4 uses allegro-config, not pkg-config. Glad you got it working. Happy coding! 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 |
|