Advertisement

SDL linker issues with main()

Started by January 25, 2005 10:22 PM
2 comments, last by chbrules 19 years, 7 months ago
I seem to have trouble setting up a new project for the basic SDL API under MSVC++ .NET 2003 Standard. I've done it once before with the help of you guys (always great help!), and I opened my compilable project and sorted through all of the project properties. All the code compiles fine, I just always get linker errors about the main function. I set in the project properties to use 'mainCRTStartup' as my startup as well as just 'main'. I have inlcuded the 2 appropriate .lib's for SDL, and even used a #pragma directive to make sure. I set the project to use a multi-threaded DLL, and made it set to a windows project (I also tried console). NOTHING seems to work! I have the same problem on another system I use under MSVC++ Beta 2005, the same exact problems. Maybe someone could take me step by step through the process of setting up and SDL project? I've read the Focus on SDL book by Ernest Panzera, he uses MSVC++ 6, as well as the online articles I've found like cone3d. I'm probably just missing something really small and stupid. Help!
-Conrad
Did you use a main in this format?
int main( int argc, char* argv[] )


Regardless if its a Win32 Console or Window, you use that format of main. Also, you are using "SDLmain.lib" as well, correct?

As for a tutorial take a look at this one for the actual code and this one to set up the project.
Advertisement
Link SDL.lib and SDLMain.lib

Under C++ -> Code Generation set Multithreaded DLL for release mode and Debug Multithreaded DLL for debug mode

http://www.icarusindie.com/DoItYourSelf/rtsr/softgel/

includes the directions. If you're just using the SDL you don't need any of the default libraries that MSVC 6 links.

Quote: Original post by Drew_Benton
Did you use a main in this format?
int main( int argc, char* argv[] )


Regardless if its a Win32 Console or Window, you use that format of main. Also, you are using "SDLmain.lib" as well, correct?

As for a tutorial take a look at this one for the actual code and this one to set up the project.


Bingo! Thanks for the links guys!
-Conrad

This topic is closed to new replies.

Advertisement