Hab das schon längst installiert!
Code:
#include <stdlib.h>
#include "SDL.h"
#include "SDL_image.h"
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
SDL_Surface *image;
SDL_Rect dest;
SDL_Event event;
SDL_Surface *display; //Fenster-Variable definieren
//Video-Modus initialisieren
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
cout << stderr << "SDL konnte nicht initialisiert werden: " << SDL_GetError() << "\n" << endl;
exit (1);
}
//Fenster initialisieren: 800x600
display = SDL_SetVideoMode(800,600,16,SDL_SWSURFACE);
if (display == NULL)
{
cout << stderr << "Konnte kein Fenster mit 800x600 öffnen: " << SDL_GetError() << "\n" << endl;
exit (1);
}
//Bild laden
image = IMG_Load("tux.jpg");
if (image == NULL)
{
cout << stderr << "Bild konnte nicht geladen werden: " << SDL_GetError() << "\n" << endl;
exit (1);
}
//Events
SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
while(SDL_WaitEvent(&event) >= 0)
{
switch(event.type) {
case SDL_QUIT:
exit(0);
break;
}
}
atexit(SDL_Quit);
return 0;
}
Wenn ich das kompillieren will, dann kommt das:
/tmp/cchUNGSH.o(.text+0x11f): In function `main':
: undefined reference to `IMG_Load'
collect2: ld returned 1 exit status
Lesezeichen