Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

USArmyMortars

SDL w/ Dev-C++

This topic is 5140 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...
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?

Share this post


Link to post
Share on other sites
Advertisement
Project->Project Options
Parameters
Add Library or Object

Then browse for the files (they will have names like libSDLmain.a)

Share this post


Link to post
Share on other sites
Ok, thanks. Now i am getting a compiling error as such:

[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 space
void 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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!