• Advertisement
Sign in to follow this  

Symbol not found: _SDL_main

This topic is 1808 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi

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?

Many thanks

Michael

 

 

Share this post


Link to post
Share on other sites
Advertisement
Main? It's a x-plane plugin hence only plugin start etc. And yes SDL.h is included. Weird that 32bit plugin works but not 64bit. The forum: forums.libsdl.org is closed? I cannot post only log in. Edited by CyberMike

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Many thanks

 

--------

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
/Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//OpenAL.framework/OpenAL,
file was built for ppc which is not the architecture being linked
(i386)

Finished building target: mac.xpl

Edited by CyberMike

Share this post


Link to post
Share on other sites

Great swiftcoder, that helped.

 

I use SDL mainly for texture and sound loading.

Regards

Michael

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement