Advertisement

SDL and main()...

Started by July 29, 2004 02:50 PM
1 comment, last by fyhuang 20 years, 2 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 ]
Are you linking with SDLmain.lib?
Advertisement
Wow, that was too obvious... thanks man!
- fyhuang [ site ]

This topic is closed to new replies.

Advertisement