got an error

Started by
5 comments, last by ontheheap 19 years, 5 months ago
I copied an pasted this from cone3d.gamedev.net but it doesn't compile
#include <stdio.h>
#include <stdlib.h>

#include <SDL/SDL.h>

SDL_Surface *back;
SDL_Surface *image;
SDL_Surface *screen;

int xpos=0,ypos=0;

int InitImages()
{
  back = SDL_LoadBMP("bg.bmp");
  image = SDL_LoadBMP("image.bmp");
  return 0;
}

int SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect,
                        SDL_Surface *dst, SDL_Rect *dstrec
void DrawIMG(SDL_Surface *img, int x, int y)
{
  SDL_Rect dest;
  dest.x = x;
  dest.y = y;
  SDL_BlitSurface(img, NULL, screen, &dest);
}

void DrawIMG(SDL_Surface *img, int x, int y,
                                int w, int h, int x2, int y2)

error: fatal error C1083: Cannot open include file: 'SDL/SDL.h': No such file or directory
-----------------------------------Panic and anxiety Disorder HQ
Advertisement
You dont have sdl.
yes I do.
------------------------------------------------------------

------------------------------------------------------------
at least I think I do.
-----------------------------------Panic and anxiety Disorder HQ
*winces*

you see the drop-down labeled "Show directories for" ?
you set it to Executable, which means either an .exe or dll. sdl.h is not an executable. you need to go to "Include", and write in the path to the folder that all of the sdl headers are in. also, if you are linking to SDL.lib and SDL_main.lib you need to include those paths too, under "Libraries" as well, but i believe (in vs.net) that goes in the "Additional Dependencies" list (can't remember where exactly that is). also make sure your applications' settings are set to using a multithreaded dll. /MD ?

cheers.
- stormrunner
Quote:Original post by stormrunner
*winces*

you see the drop-down labeled "Show directories for" ?
you set it to Executable, which means either an .exe or dll. sdl.h is not an executable. you need to go to "Include", and write in the path to the folder that all of the sdl headers are in. also, if you are linking to SDL.lib and SDL_main.lib you need to include those paths too, under "Libraries" as well, but i believe (in vs.net) that goes in the "Additional Dependencies" list (can't remember where exactly that is). also make sure your applications' settings are set to using a multithreaded dll. /MD ?

cheers.


Holy hell! What a pain in the ass. All I have to do is:

g++ -o main main.cpp `sdl-config --cflags --libs`

Sometimes linux just kicks so much ass. [grin]
Quote:Original post by ontheheap
Quote:Original post by stormrunner
*winces*

you see the drop-down labeled "Show directories for" ?
you set it to Executable, which means either an .exe or dll. sdl.h is not an executable. you need to go to "Include", and write in the path to the folder that all of the sdl headers are in. also, if you are linking to SDL.lib and SDL_main.lib you need to include those paths too, under "Libraries" as well, but i believe (in vs.net) that goes in the "Additional Dependencies" list (can't remember where exactly that is). also make sure your applications' settings are set to using a multithreaded dll. /MD ?

cheers.


Holy hell! What a pain in the ass. All I have to do is:

g++ -o main main.cpp `sdl-config --cflags --libs`

Sometimes linux just kicks so much ass. [grin]


if you reckon ... VS.net is sooooooo much better than having to remember command syntax's. Once you've set these values up all you need to do is hit build. Once you linux project gets large > 20 files you'll either need a makefile or use an ide then you'll be back with us mere mortals entering stuff into config screens :)
I'll give ya that one... [razz]

This topic is closed to new replies.

Advertisement