NO

Author Topic: SDL probs  (Read 4672 times)

dmoc

  • Guest
SDL probs
« on: May 10, 2005, 04:32:10 PM »
@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.

Ngan Lo

  • Guest
SDL probs
« Reply #1 on: May 10, 2005, 05:41:45 PM »
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.

dmoc

  • Guest
SDL probs
« Reply #2 on: May 10, 2005, 05:46:40 PM »
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.


dmoc

  • Guest
SDL probs
« Reply #3 on: May 10, 2005, 05:48:06 PM »
Ngan Lo, how to do this?

Timppa

  • Guest
SDL probs
« Reply #4 on: May 10, 2005, 06:24:52 PM »
Have You checked "Define compatibility names" from project Compiler options

Anonymous

  • Guest
SDL probs
« Reply #5 on: May 10, 2005, 11:08:45 PM »
Timppa, thanks that seems to have worked.