@Pelle: great looking compiler. I hope to use it a lot =D>
Maybe this should be in the C/newbie section because it's been a while since I have done any C programming. Anyways... I'd like to try some x-platform programming with SDL and have now actually managed to compile the SDL "testwin" program. However, I'm not sure if I have installed SDL correctly so could someone please confirm...
- Downloaded sdl source, vc dev and runtime
- Put sdl.dll into system32 dir
- Added SDL dev dirs "include" and "lib" to Pelles tools/options/folders (under the appropriate headings)
I have not actually compiled SDL using PellesC since I figured the libs and dll are already supplied. Correct?
To test I opened the testwin.c code in Pelles, tried to compile and accepted the prompt to create a project. Once that failed I added sdl.lib, SDLmain.lib and msvcrt.lib to the projects linker options and this at least got the program compiled. Result is a blank unresponsive window :|
Any/all help appreciated.
have u make the sdl_main.lib using pellesc ? as i remember SDL has been discussed here, the solution is make sdl_main.lib with pellesc.
Update: I tried following instructions from SDL's site for LCC-win which says to add SDL_win32_main.c to the project. When I do this PellesC says:
Quote
Building testwin.obj.
Building SDL_win32_main.obj.
Use <stdlib.h> instead of non-standard <malloc.h>
C:\Documents and Settings\Derek\My Documents\std\dev\sdl\SDL-1.2.8\src\main\win32\SDL_win32_main.c(210): warning #2027: Missing prototype for 'alloca'.
C:\Documents and Settings\Derek\My Documents\std\dev\sdl\SDL-1.2.8\src\main\win32\SDL_win32_main.c(244): warning #2027: Missing prototype for 'SDL_SetModuleHandle'.
C:\Documents and Settings\Derek\My Documents\std\dev\sdl\SDL-1.2.8\src\main\win32\SDL_win32_main.c(345): warning #2027: Missing prototype for 'alloca'.
Building testwin.exe.
POLINK: error: Unresolved external symbol '_alloca'.
POLINK: fatal error: 1 unresolved external(s).
*** Error code: 1 ***
Done.
As SDL_win32_main.c already references stdlib.h I comment out the reference to malloc.h but then I get the result shown below. Suspect I'm missing something simple so could someone please point out what it is?
Quote
Building SDL_win32_main.obj.
C:\Documents and Settings\Derek\My Documents\std\dev\sdl\SDL-1.2.8\src\main\win32\SDL_win32_main.c(210): warning #2027: Missing prototype for 'alloca'.
C:\Documents and Settings\Derek\My Documents\std\dev\sdl\SDL-1.2.8\src\main\win32\SDL_win32_main.c(244): warning #2027: Missing prototype for 'SDL_SetModuleHandle'.
C:\Documents and Settings\Derek\My Documents\std\dev\sdl\SDL-1.2.8\src\main\win32\SDL_win32_main.c(345): warning #2027: Missing prototype for 'alloca'.
Building testwin.exe.
POLINK: error: Unresolved external symbol '_alloca'.
POLINK: fatal error: 1 unresolved external(s).
*** Error code: 1 ***
Done.
Ngan Lo, how to do this?
Have You checked "Define compatibility names" from project Compiler options
Timppa, thanks that seems to have worked.