English 中文(简体)
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?

最佳回答

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
问题回答

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.

@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

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

mkdir build
cd build
cmake ..
make
sudo make install




相关问题
OpenGL 3D Selection

I am trying to create a 3D robot that should perform certain actions when certain body parts are clicked. I have successfully (sort of) implemented picking in that if you click on any x-plane part, it ...

Why and when should you use hoops 3d graphics? [closed]

My company needs 3D visualization for our commercial applications (CAD, mesh manipulation, computational geometry). We are tired of true vision 3D (tv3d), which we ve been using for years (poor ...

Prerequisite for learning directx

I am from .net C# background and I want to learn DirectX. I have knowledge of C++ but I am fairly new to graphic world. I am little confused about how to start learning directx, should I start ...

Radial plotting algorithm

I have to write an algorithm in AS3.0 that plots the location of points radially. I d like to input a radius and an angle at which the point should be placed. Obviously I remember from geometry ...

Determine VRAM size on windows

I need to determine roughly how much VRAM a system s graphics card has. I know all the reasons why I shouldn t but I do. It doesn t need to be perfect (some cards lie etc.) but I need a ballpark. On ...

Mask white color out of PNG image on iPhone

I know that there are already 2 relevant posts on that, but it s not clear... So the case is this...: I have a UIImage which consists of a png file requested from a url on the net. Is it possible to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签