SDL.framework without Project Builder

I would really like to know if and how it is possible to use command
line tools only to compile against and link with Frameworks on OS X.

This is specifically related to the SDL.framework.

I have a simple.c file with the lines

#include “SDL.h”

int main () {}

and I have tried variations on:
cc -F~/Library/Frameworks -framework SDL simple.c
simple.c:1: header file ‘SDL.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode

Documentation on apple’s site says the preprocessor can handle
frameworks. Am I not passing the parameters correctly?

Dave

I don’t know if this is right, but projectbuilder shows you what look to
me like
command-line calls to build your app and you can specify extra compiler
options
and things from within projectbuilder.

As it appears to me -framework SDL should work.
Next time I’m at my development machine I’ll check on how to set the
search
directories for the frameworks and I’ll check to see if this is even
true.

-Randall LeedsOn Wednesday, February 27, 2002, at 10:44 , David Leimbach wrote:

I would really like to know if and how it is possible to use command
line tools only to compile against and link with Frameworks on OS X.

This is specifically related to the SDL.framework.

I have a simple.c file with the lines

#include “SDL.h”

int main () {}

and I have tried variations on:
cc -F~/Library/Frameworks -framework SDL simple.c
simple.c:1: header file ‘SDL.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode

Documentation on apple’s site says the preprocessor can handle
frameworks. Am I not passing the parameters correctly?

Dave


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I should correct below… this doesn’t imply a direct problem with the
SDL framework. I just
would like to know I can use the command line with Framework as well as
Project Builder.On Wednesday, February 27, 2002, at 09:44 PM, David Leimbach wrote:

I would really like to know if and how it is possible to use command
line tools only to compile against and link with Frameworks on OS X.

This is specifically related to the SDL.framework.

I have a simple.c file with the lines

#include “SDL.h”

int main () {}

and I have tried variations on:
cc -F~/Library/Frameworks -framework SDL simple.c
simple.c:1: header file ‘SDL.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode

Documentation on apple’s site says the preprocessor can handle
frameworks. Am I not passing the parameters correctly?

Dave


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Sorry, I hadn’t read your first post right, didn’t realize you were
using -framework
already :P.

For ProjectBuilder I use $(HOME) instead of ~ to denote your home
directory.
Try using that.
Other keywords are things like $(SYSTEM_DEVELOPMENT_DIR) or some-such
thing, and I believe there are a bunch of other ones out there.

-Randall LeedsOn Wednesday, February 27, 2002, at 10:44 , David Leimbach wrote:

I would really like to know if and how it is possible to use command
line tools only to compile against and link with Frameworks on OS X.

This is specifically related to the SDL.framework.

I have a simple.c file with the lines

#include “SDL.h”

int main () {}

and I have tried variations on:
cc -F~/Library/Frameworks -framework SDL simple.c
simple.c:1: header file ‘SDL.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode

Documentation on apple’s site says the preprocessor can handle
frameworks. Am I not passing the parameters correctly?

Dave


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I don’t know if this is right, but projectbuilder shows you what look
to me like
command-line calls to build your app and you can specify extra compiler
options
and things from within projectbuilder.

Yeah I thought so too but CompileC isn’t anywhere on the disk.

"sudo find / -name "CompileC"
yielded nothing

As it appears to me -framework SDL should work.
Next time I’m at my development machine I’ll check on how to set the
search
directories for the frameworks and I’ll check to see if this is even
true.

Thanks I would really appreciate it. I have searched all over the web
and one of two things is true:

I believe project builder is actually resolving some symbolic links at
compile time. I am not certain this can be done at the command line but
I really hope it can be done.On Wednesday, February 27, 2002, at 09:50 PM, Randall Leeds wrote:

-Randall Leeds

On Wednesday, February 27, 2002, at 10:44 , David Leimbach wrote:

I would really like to know if and how it is possible to use command
line tools only to compile against and link with Frameworks on OS X.

This is specifically related to the SDL.framework.

I have a simple.c file with the lines

#include “SDL.h”

int main () {}

and I have tried variations on:
cc -F~/Library/Frameworks -framework SDL simple.c
simple.c:1: header file ‘SDL.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode

Documentation on apple’s site says the preprocessor can handle
frameworks. Am I not passing the parameters correctly?

Dave


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Sorry, I hadn’t read your first post right, didn’t realize you were
using -framework
already :P.

For ProjectBuilder I use $(HOME) instead of ~ to denote your home
directory.
Try using that.

I will try that. Thanks. BTW if you type cpp -v at the command line
you get:
NU CPP version 2.95.2 19991024 (release)
#include “…” search starts here:
#include <…> search starts here:
/usr/include
/usr/include/gcc/darwin/2.95.2/g++/…
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/local/include/c++
/usr/include/gcc/darwin/2.95.2/g++
/usr/local/include
/System/Library/Frameworks/System.framework/Headers
End of omitted list.

Now I know that is probably not cpp-precomp which is the one that is run
when you execute cc [and seemingly the preprocessor for c++ is NOT
cpp-precomp… this makes sense if you use templates… unless OS X has
"export" support in its compilers].

sigh… I’ll keep trying. Resistance is NOT futile :slight_smile:

DaveOn Wednesday, February 27, 2002, at 09:53 PM, Randall Leeds wrote:

Other keywords are things like $(SYSTEM_DEVELOPMENT_DIR) or some-such
thing, and I believe there are a bunch of other ones out there.

-Randall Leeds

On Wednesday, February 27, 2002, at 10:44 , David Leimbach wrote:

WOO HOO! Success… even though there is an error in my code :).

For anyone interested this is how you do it!

Unfortunately this makes code less portable but its the way frameworks
work on OS X.

#include <SDL/SDL.h> [from page 11 in the Preprocessor Developer docs
included with OS X DUH]------------------------------------------------------------------------------------------------------------------------
For frameworks the semantics of the text between the angle brackets is
different. The word preceding the slash indicates a framework. Thus the
line:
<AppKit/AppKit.h>
causes the search for the header file AppKit.h to occur in the
Application Kit
framework (/System/Library/Frameworks/AppKit.framework). The
PrivateHeaders
subdirectory is searched first, and then the Headers directory, thus
allowing a
private header file to override a public one. The flags -F ,-I, and -L
affect
search path for frameworks (see ?Invoking the Preprocessor,? below); The
linker?s -framework
flag, however, has no effect.

This seems that it will unfortunate introduce a whole new generation of
#ifdef’s in my code if you are compiling at the command line.

here are my results :
dave% cc -F$HOME/Library/Frameworks test.c
/usr/bin/ld: Undefined symbols:
_main

~ didn’t work but $HOME did. Thanks for that last tip Randall!

Anyway that covers compiling but not linking…
Ideas about how to proceed?

Dave
On Wednesday, February 27, 2002, at 09:53 PM, Randall Leeds wrote:

Sorry, I hadn’t read your first post right, didn’t realize you were
using -framework
already :P.

For ProjectBuilder I use $(HOME) instead of ~ to denote your home
directory.
Try using that.
Other keywords are things like $(SYSTEM_DEVELOPMENT_DIR) or some-such
thing, and I believe there are a bunch of other ones out there.

-Randall Leeds

On Wednesday, February 27, 2002, at 10:44 , David Leimbach wrote:

I would really like to know if and how it is possible to use command
line tools only to compile against and link with Frameworks on OS X.

This is specifically related to the SDL.framework.

I have a simple.c file with the lines

#include “SDL.h”

int main () {}

and I have tried variations on:
cc -F~/Library/Frameworks -framework SDL simple.c
simple.c:1: header file ‘SDL.h’ not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode

Documentation on apple’s site says the preprocessor can handle
frameworks. Am I not passing the parameters correctly?

Dave


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl