Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Advice on OS X ....PLEASE

This thread is locked; no one can reply to it. rss feed Print
Advice on OS X ....PLEASE
scottslinux
Member #11,957
May 2010

I have a new macbook pro and am having difficulty getting Allegro set up on it. I am not a total noob. I have been using allegro with code blocks in Ubuntu and even run it on that macbook using ubuntu and virtualbox. But I would really like to get it up and running in OSX. I installed Allegro from the tar file and even from MacPorts. As Xcode seems to have issues of its own when it comes to getting allegro installed i have tried compiling and linking from the command line. I get this error...

Quote:

gcc main.cpp -o `allegro-config --libs`

ld: warning: in /opt/local/lib/liballeg-main.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in /opt/local/lib/liballeg.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
"std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
_mangled_main() in cceh8pO4.o
"_main", referenced from:
start in crt1.10.6.o
(maybe you meant: __mangled_main_address, _mangled_main() )
"_rest", referenced from:
_mangled_main() in cceh8pO4.o
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int)in cceh8pO4.o
"_set_gfx_mode", referenced from:
_mangled_main() in cceh8pO4.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const", referenced from:

*******************************************
of course it goes on not to recognize all of the routines and variables associated with Allegro. I think that the real meat of the problem is the architecture error. Do I need a Universal version of allegro?? Is there one??

-I would really appreciate any assistance. I am new to allegro but really am loving it and would like to write some stuff on the MacBook side of the virtual machine. Thanks in advance for any help.

Scott

Arthur Kalliokoski
Second in Command
February 2005
avatar

They all watch too much MSNBC... they get ideas.

scottslinux
Member #11,957
May 2010

I do appreciate the rapid reply. It seems that installing Allegro to OS X is significantly more troublesome than installing it to linux. This is unfortunate since Xcode is a very nice interface and code blocks for Mac is essentially non-functional with all of its instability. I have seen all of these sites and have tried to follow all of their advice but to no avail. It seems that I am having a 64 bit versus 32 bit conflict.

Scott

Arthur Kalliokoski
Second in Command
February 2005
avatar

This page

http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/OSX

says

"Allegro is 32bit only, 64bit is not supported yet"

But you have the `allegro-config --libs`, does this mean you're trying to use 4.4.x or earlier?

They all watch too much MSNBC... they get ideas.

scottslinux
Member #11,957
May 2010

what would be the linker invocation line for allegro 5 ???? perhaps that is the problem. Maybe because I have been through several installs I am still refering back to 4.2 ????? I usually put G++ file.cpp `allegro-config -libs`

perhaps this is not correct. I just followed the directions and installed 5 using cmake.....how do I use it from the command line????

Arthur Kalliokoski
Second in Command
February 2005
avatar

I thought I saw the correct linker thing in allegro forums, but I can't find it now. On the rare occasion I link in A5 in Linux, I just grep for the functions in /usr/local/lib and add those libraries. :-X

I did find this

Quote:

To compile this example, you will need to link with the Allegro 5 library as well as the a5_ttf library. Take note, because this detail will not be included in future tutorials. (Thanks to Trent Gamblin and Chris Johnston for making my compiler lines more cross-platform.) Use the following commands:

Linux users:

$ gcc hello1.c -o hello1 -allegro_ttf-4.9.8 -allegro_font-4.9.8 \ `allegro-config --libs`

Windows users:

Quote:

gcc hello1.c -o hello1 -allegro_ttf-4.9.8 -allegro_font-4.9.8 \ -allegro-4.9.8

(Replace "-4.9.8" with your version of the library. As of the writing of this article, that was the most recent version, and it is now required of the add-on libraries. Presumably, when the API is stable the version number will be dropped from the library names.)

All other users: My apologies if you use MacOSX, Microsoft Visual Studio, or any other compiler or operating system. I cannot help you with the precise syntax for compilation or configuration. Bold text

on this page

http://wiki.allegro.cc/index.php?title=Tutorial_2:_TrueType_Fonts_and_Display_Modes

They all watch too much MSNBC... they get ideas.

scottslinux
Member #11,957
May 2010

Thank you all so much !!!!!!!!

I finally got it after trying for weeks. I think that I was installing Allegro correctly to the Mac. In fact, I am sure that I must have installed it a dozen times !!! But with you guidance I came across this page in my travels :

http://awiki.tomasu.org/index.php?title=Xcode

And that details how to configure the build setting in Xcode. Suddenly I went from 37 errors to none and in 2 minutes I got that beautiful black Allegro window. This is one of those moments when you succeed at something that you have been working at for some time and in an instant it pops! Thanks again for all of your rapid assistance.

Scott

Trent Gamblin
Member #261
April 2000
avatar

For Allegro pre 4.9, the library is built as a 32 bit library, so when you compile your program, add -m32 to the gcc command.

Evert
Member #794
November 2000
avatar

This page

http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/OSX

says

"Allegro is 32bit only, 64bit is not supported yet"

Don't remember adding that there. It's wrong; I've been using 64 bit Allegro for months.

Anyway, yes, pre-4.9 Allegro is limited to 32 bit on OS X.
The question on how to setup Allegro with XCode pops up a lot, I'll have to remember that link. I don't use XCode myself, so I can never answer that particular question when it comes to OS X (compiling and installing Allegro in OS X is no more difficult than doing it in Linux, where I wouldn't know how to set ut up with an IDE either).

Go to: