Using SDL2 with pelles c?

Started by cprog, November 09, 2013, 04:24:37 PM

Previous topic - Next topic

cprog

Has anyone successfully used SDL2 with pelles c? I learned that the older version required for SDLmain to be recompiled for compatibility, and it was as simple as importing a MSVC project. With the newer SDL2, I have not been able to do anything. Is there someone here that might know what steps need to be taken to get it up and running with pelles c?

cprog

This is the error I get.


POLINK: fatal error: File not found: 'MSVCRT.lib'.


I understand that Pelles C does not use MSVCRT.lib, so this is why SDL2main has to be recompiled. I just wanted to point out the error message, to be more specific on what I need help with.

cprog

I solved the problem. I was too quick to think that SDL2 had major differences. So basically, the same procedure that was used for SDL 1.2 that requires you to recompile SDLmain works for SDL2main. 2 even compiles much better and without warnings or errors than 1.2. The only real problem is that only Visual Studio 2008 and up, MSVC projects are included, so you have to manually setup the project, but it works great.

TimoVJL

Minimal SDL_MainW.c for SDL2// SDL_MainW.c

int __cdecl main(int argc, char* argv[]);
#ifdef __POCC__
extern int __argc;
extern char **__argv;
#endif
int __stdcall WinMain(int hInstance, int hPrevInstance, char* lpszCmdLine, int nCmdShow)
{
return main(__argc, __argv);
}
May the source be with you