Sign in to follow this  
CyberMike

Symbol not found: _SDL_main

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this