Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling OpenGL SOIL on Mac OS X

How would I link in or compile SOIL (http://lonesock.net/soil.html) into my C++ OpenGL project on Mac OS X?

like image 747
weicool Avatar asked Dec 10 '09 23:12

weicool


2 Answers

On newer versions of Mac OS X, such as Leopard, you'll have to edit the make file and add

'-arch 1386 -arch x86_64'

to the CXX macro of the Makefile. After compiling, you'll also have to link in the CoreFoundation.framework in your project. So your final build command might look something like

gcc -Wall -lSOIL -framework OpenGL -framework GLUT -framework CoreFoundation
like image 59
revenantphoenix Avatar answered Sep 18 '22 13:09

revenantphoenix


There's a makefile in the zip that you could try using (projects/makefile). You'll want to rename makefile to __M__akefile (capital M), then just run make in the projects/makefile directory. You'll also need to create the folder for it to put the compiled objects into

From a command line prompt

cd <path to unpacked SOIL archive>
cd projects/makefile
cp makefile Makefile
mkdir obj
make

This builds fine on Linux, and should work on OS X provided you have a C compiler installed.

like image 44
Adam Luchjenbroers Avatar answered Sep 19 '22 13:09

Adam Luchjenbroers