Reply To: [Resolved]Unable to open I2C bus

Home Forums Forums Technical Support for BerryIMU [Resolved]Unable to open I2C bus Reply To: [Resolved]Unable to open I2C bus

#3972
jawood
Participant

Ok so I dod the SDL install
sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-ttf2.0-dev

sudo nano test.c

copy

#include <SDL/SDL.h>

int main(int argc, char** argv) {
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Surface *screen;

screen = SDL_SetVideoMode( 480, 320, 16, SDL_SWSURFACE );
SDL_Rect rect;
rect.x = 10;
rect.y = 10;
rect.w = 20;
rect.h = 20;

Uint32 color = SDL_MapRGB(screen->format, 0xff,0xff,0xff);
Uint32 color2 = SDL_MapRGB(screen->format, 0,0,0);
SDL_FillRect(screen, &screen->clip_rect, color);
SDL_Flip(screen);
getchar();

SDL_Quit();
return 0;
}

gcc -o test test.c sdl-config –cflags sdl-config –libs

Get error:-

Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]
/tmp/ccM8y3Uh.o: In function `main':
test.c:(.text+0x18): undefined reference to `SDL_Init'
test.c:(.text+0x2c): undefined reference to `SDL_SetVideoMode'
test.c:(.text+0x6c): undefined reference to `SDL_MapRGB'
test.c:(.text+0x8c): undefined reference to `SDL_MapRGB'
test.c:(.text+0xa8): undefined reference to `SDL_FillRect'
test.c:(.text+0xb0): undefined reference to `SDL_Flip'
test.c:(.text+0xb8): undefined reference to `SDL_Quit'
collect2: ld returned 1 exit status

Ow and thanks for all your help so far

Blip, blop, bloop...