Using libsdl-framework

Braden McDaniel braden at endoframe.com
Sun Nov 30 22:39:25 PST 2008


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>

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

... 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?

-- 
Braden McDaniel                      e-mail: <braden at endoframe.com>
<http://endoframe.com>               Jabber: <braden at jabber.org>


More information about the macports-users mailing list