Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cross-platform Linux/OS X Development w/ SDL



Hi All,

I've been developing OpenGL software under Linux using the SDL libraries for my graduate thesis. I recently purchased my first Mac and I'm trying to setup my project so I can easily work on either platform (using #ifndef to cover any changes that are platform specific). Unfortunately I'm having trouble compiling my project under OS X.

So far I've installed Xcode 1.5 and the SDL Development Library 1.2.8 (Project Builder + XCode) (looks like OpenGL was included with the development kit). When I try creating a new Cocoa SDL OpenGL application, it'll compile fine.

However when I try running the Makefile which I use in Linux, I get a bunch of errors. Most of them deal with not being able to locate the SDL and OpenGL header files. I'm not sure how to deal with this under the Mac environment since I'm new to the "Framework" concept (all the header files that I need are located in an OpenGL.framework and SDL.framework directories).

I'm wondering if can specify frameworks or something like that in my Makefile? I apologize if this is a simple question, but I've been having trouble finding information about getting Linux Makefiles for OpenGL applications to work under OS X. Most of what I find deals with how to setup your project in Xcode.

Thanks for your help!
Achal

Pasted below are some relevant code snippets:

<<First few lines of Makefile>>

CC = gcc
CPPFLAGS  = -g -Wall -O0
SDLCFLAGS = `sdl-config --cflags`
LDSDLFLAGS = `sdl-config --libs`
LDOPENGLFLAGS = -lGLU -lGL
LDFLAGS = -L${LD_LIBRARY_PATH} ${LDSDLFLAGS} ${LDOPENGLFLAGS}

<<Output of running Makefile>>

$ make
gcc -g -Wall -O0 -c Camera.cpp `sdl-config --cflags`
/bin/sh: line 1: sdl-config: command not found

In file included from Camera.cpp:1:
Camera.h:4:19: GL/gl.h: No such file or directory

In file included from Camera.cpp:1:
Camera.h:19: error: `GLfloat' was not declared in this scope

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.