on OSX with -arch i386 all is fine but with x86_64 I get the above runtime error.
What do I need to change for 64bit?
Jump to content
Posted 05 February 2013 - 09:47 AM
Edited by CyberMike, 05 February 2013 - 09:50 AM.
Posted 05 February 2013 - 09:52 AM
Ok you mentioned none of that in your original post.
I'm not sure SDL supports being loaded in a plug-in. It expects to be the entry point on some systems. You might have just been lucky that it worked in your original configuration at all. You may be able to make it work, but you might have to modify SDL to do so.
Posted 05 February 2013 - 02:44 PM
SDL performs some truly idiotic magic to make sure that you can call your main function "main()" even on platforms where it needs to be called something else (i.e. using WinMain instead on Windows). They accomplish this by having a #define main SDL_main in their header file, which allows them to transparently preempt your main function and insert their own...
Long story short, you can't use SDL from a plugin without deleting that #define from their header files.
Posted 06 February 2013 - 01:14 AM
Below as it works in 32bit. Swiftcoder, so I should simply delete all: #define main SDL_main
that I find within sdl headers? I'll try that right now.
Invoking: MacOS X C++ Linker
g++ -arch i386 -L/usr/local/lib -L/usr/X11R6/lib -framework OpenGL
-framework Cocoa -framework OpenAL -framework SDL -framework SDL_image
/Users/mike/workspace/P2/SDLMain.m -undefined warning -flat_namespace
-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
-dynamiclib -o "mac.xpl" ./main.o -lgl -lglu
ld: warning: in
file was built for ppc which is not the architecture being linked
Finished building target: mac.xpl
Edited by CyberMike, 06 February 2013 - 01:16 AM.