NO

Author Topic: Using SDL2 with pelles c?  (Read 4242 times)

cprog

  • Guest
Using SDL2 with pelles c?
« on: November 09, 2013, 04:24:37 PM »
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

  • Guest
Re: Using SDL2 with pelles c?
« Reply #1 on: November 09, 2013, 04:34:48 PM »
This is the error I get.

Code: [Select]
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

  • Guest
Re: Using SDL2 with pelles c?
« Reply #2 on: November 09, 2013, 05:02:10 PM »
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.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: Using SDL2 with pelles c?
« Reply #3 on: November 09, 2013, 05:18:54 PM »
Minimal SDL_MainW.c for SDL2
Code: [Select]
// 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