Skip to main content

Thread: Geany and SDL


i'm using development environment called geany handles multiple languages , since i'm taking variety of programming courses seemed appropriate go one, can't life of me sdl play nice it. i've tried various fixes ranging reinstalling packages trying link hand nothing working here's original error output , code generated it. maybe can shed light on me.

//include sdl functions , datatypes
#include "sdl/sdl.h"
int main( int argc, char* args[] ) {
//the images
sdl_surface* hello = null;
sdl_surface* screen = null;
//start sdl
sdl_init( sdl_init_everything );
//set screen
screen = sdl_setvideomode( 640, 480, 32, sdl_swsurface );
//load image
hello = sdl_loadbmp( "hello.bmp" );
//apply image screen
sdl_blitsurface( hello, null, screen, null );
//update screen
sdl_flip( screen );
//pause
sdl_delay( 2000 );
//free loaded image
sdl_freesurface( hello );
//quit sdl
sdl_quit();
return 0;
}

gcc -wall -o "basicsdl" "basicsdl.c" (in directory: *omitted: irrelevant error*)
/tmp/ccv8txp6.o: in function `main':
basicsdl.c:(.text+0x25): undefined reference `sdl_init'
basicsdl.c:(.text+0x3e): undefined reference `sdl_setvideomode'
basicsdl.c:(.text+0x51): undefined reference `sdl_rwfromfile'
basicsdl.c:(.text+0x5e): undefined reference `sdl_loadbmp_rw'
basicsdl.c:(.text+0x7c): undefined reference `sdl_upperblit'
basicsdl.c:(.text+0x88): undefined reference `sdl_flip'
basicsdl.c:(.text+0x92): undefined reference `sdl_delay'
basicsdl.c:(.text+0x9e): undefined reference `sdl_freesurface'
basicsdl.c:(.text+0xa3): undefined reference `sdl_quit'
collect2: ld returned 1 exit status
compilation failed.

you need link program sdl using -lsdl flag.

need go build -> set includes , arguments in geany , add -lsdl flag (see attachment).
attached images attached images


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Geany and SDL


Ubuntu

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい