Anders F Björklund wrote:
Braden McDaniel wrote:

Is MacPorts' libsdl-framework usable directly from C and C++, or do I need an Objective-C entry point as described here?

  <http://www.libsdl.org/faq.php?action=listentries&category=7#55>

For Cocoa backend with SDL 1.2 you need a SDLMain entry point.
Normally this is handled by `sdl-config`, not so with Xcode.

Ah, you mean if I'm using libsdl (i.e., not the framework variant).

When I try to compile this program:

  #include <SDL/SDL.h>
  int main(int argc, char * argv[])
  {
    SDL_Init(0);
  }

... like this:

  gcc -o foo -framework SDL foo.c

You are missing a "-F/opt/local/Library/Frameworks", as well ?
(so that it can find it in the ${prefix}, like with -I or -L)

libsdl-framework appears to get installed to /Library/Frameworks, so this is not required.

... I get this linker error:

  Undefined symbols:
    "_main", referenced from:
        start in crt1.10.5.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status

-lSDLmain didn't help (AFAICT, the framework provides no libSDLmain.a); is there some other alternative?

libSDLmain.a is only included with the library (non-framework)
version of SDL, with the framework you need to compile SDLMain.m

Okay; thanks for the confirmation.

--
Braden McDaniel                      e-mail: <[EMAIL PROTECTED]>
<http://endoframe.com>               Jabber: <[EMAIL PROTECTED]>
_______________________________________________
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to