quote:Now in Dev-C++ start a new console project. Now go to the project options dialog (found in the menu Project). The thing we need to set here is the field that says "Further object files or linker options:". Type in "-lmingw32 -lSDLmain -lSDL" (w/o the quotes) inside it. Now click OK.I cannot find "Further object files or linker options:" anywhere in project options. If because i am using a newer version than when the tutorial was built, can anyone tell me where i can input these linker commands at?
SDL w/ Dev-C++
I am reading the 1st tutorial on the Cone3D site on how to initialize a SDL window. I am using Bloodshed Dev-C++ v4.8.9.0, and the tutorial tells me to do this...
Project->Project Options
Parameters
Add Library or Object
Then browse for the files (they will have names like libSDLmain.a)
Parameters
Add Library or Object
Then browse for the files (they will have names like libSDLmain.a)
Ok, thanks. Now i am getting a compiling error as such:
[Linker error] undefined reference to `WinMain@16'
here is the code
why am i getting this error?
EDIT:
i added these libraries:
lib/libSDL.a
lib/libSDLmain.a
lib/libmingw32.a
but the tutorial tells me to type in "-lmingw32 -lSDLmain -lSDL"
(w/o the quotes)
[edited by - usarmymortars on May 25, 2004 1:44:53 PM]
[Linker error] undefined reference to `WinMain@16'
here is the code
#include <stdio.h>#include <stdlib.h>#include <SDL/SDL.h>// The functions are not shown to save spacevoid DrawPixel(SDL_Surface *screen, int x, int y, Uint8 R, Uint8 G, Uint8 B);void Slock(SDL_Surface *screen);void Sulock(SDL_Surface *screen);int main(int argc, char *argv[]){ if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 ) { printf("Unable to init SDL: %s\n", SDL_GetError()); exit(1); } atexit(SDL_Quit); SDL_Surface *screen; screen=SDL_SetVideoMode(640,480,32,SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN); if ( screen == NULL ) { printf("Unable to set 640x480 video: %s\n", SDL_GetError()); exit(1); } // DRAWING GOES HERE return 0;}
why am i getting this error?
EDIT:
i added these libraries:
lib/libSDL.a
lib/libSDLmain.a
lib/libmingw32.a
but the tutorial tells me to type in "-lmingw32 -lSDLmain -lSDL"
(w/o the quotes)
[edited by - usarmymortars on May 25, 2004 1:44:53 PM]
In SDL docs it was mentioned that the order of the libraries matters. Just use the order given in the tutorial.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement