🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

SDL and main()...

Started by
1 comment, last by fyhuang 19 years, 11 months ago
The following should work perfectly (at least I think):

#include "../FreeGL/FreeGL.h"
using namespace FreeGL;

int main( int argc, char *argv[] )
{
	new Root();
	Root::getSingleton().initialize( argc, argv, "FreeGL.cfg" );
	Root::getSingleton().run();
	delete Root::getSingletonPtr();
	ManagedObject::collectRemainingObjects( true );
	return 0;
}
Where FreeGL is the engine I am developing and FreeGL.h includes SDL.h. The project is linked with SDL.lib and stuff, but the linker still complains of a missing symbol _main(). I know SDL is supposed to rename main() to sdl_main() and provide it's own main(), but it doesn't look like it's happening. Anyone have any ideas?
- fyhuang [ site ]
Advertisement
Are you linking with SDLmain.lib?
Wow, that was too obvious... thanks man!
- fyhuang [ site ]

This topic is closed to new replies.

Advertisement