Compiling OpenGL SOIL on Mac OS X
Asked Answered
M

4

10

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

Malcommalcontent answered 10/12, 2009 at 23:17 Comment(0)
A
11

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
Astyanax answered 2/2, 2010 at 0:29 Comment(2)
Is this when you compile SOIL or your program? Tried both but still get [file was built for archive which is not the architecture being linked].Befitting
Should be -arch i386 -arch x86_64 (note the i instead of 1).Payola
H
8

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.

Heighttopaper answered 16/12, 2009 at 8:7 Comment(0)
S
0

@Adam Luchjenbroers: Actually you can just run make -f makefile and it will work (at least with my current version of make)

You can pass any file to make with the -f flag

Snowstorm answered 18/4, 2014 at 21:53 Comment(0)
M
0

Clone https://github.com/DeVaukz/SOIL move to the downloaded directory.

mkdir build
cd build
cmake ..
make
sudo make install
Metallic answered 27/10, 2017 at 17:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.