Jump to content
  • Advertisement
Sign in to follow this  

Unity Entry point and SDL

This topic is 4446 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

Hello, I.m trying to setup a starting project that will use SDL, but it seems it wont work du to some SDL entry point re-mapping. So basically my source file is:
#include <SDL.h>

int main(int argc, char *argv[])
	return 0;

the build log is:
------ Rebuild All started: Project: Motus, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'Motus', configuration 'Debug|Win32'
LINK : fatal error LNK1561: entry point must be defined
Motus - 1 error(s), 0 warning(s)
I'v already read this topic (will open on a new window) but it did not help. I'm not too newbie relative to visual c++ (express), so I guess I've set up the project almost rightly. - Include directories: I:\sdk\SDL\include - Lib Directories: I:\sdk\SDL\lib - Additionnal dependencies: SDLmain.lib SDL.lib - The project is set to compile as C code (/TC) - Debug build, all optimization stuff is disabled - I've tried to add extern "C" to my main but it did not work either (error: string, of course, as C code. And as Cpp code the entry point is still not found, but I need my project to be plain C anyway) I hope I included all relevant information, and that someone can help me. Regards, Janta

Share this post

Link to post
Share on other sites
So, I eventually fixed this, after couple hours tweaking with VC++ options.
I'm far far away from being an expert, so this is what was probably happenning, I guess.

SDL turn your main() into an SDL_main(), so your main is not the actual entry point any more.
So you need to inform your compiler about the target subsystem so as it can determine the appropriate entry point. (I don't have a deep understanding about that...)

So what fixed my problem with VC++ Express is set the SubSystem to Windows in
Properties -> Linker -> System -> SubSystem.

Maybe it could help someone, someday.

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!