[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcaca] undefined reference



I've a stupid problems when compiling this simple code:

/*
 * caca_test.1.c          simple libcaca program
 * authors                blackcode
 * email                  [[REDACTED]][at]gmail[dot]com
 *
 * description:
 * a basic example about the use of libcaca
 */
#include <cucul.h>
#include <caca.h>
int main(void)
{
	int x,y;
	x=0; y=0;

	cucul_canvas_t *cv; caca_display_t *dp; caca_event_t *events;
	cv = cucul_create_canvas(80,24);

  if(!cv)
  {
  	printf("errore nella creazione di canvas!\n");
	return 1;
  }

  dp = caca_create_display(cv);
  if(!dp)
  {
  	printf("errore nella creazione del display!\n");
	return 1;
  }

  caca_set_display_title(dp, "example 1");
  cucul_set_color_ansi(cv, cucul_black, cucul_white);
  cucul_put_str(cv, 40, 12, "this is a message");
  caca_refresh_display(dp);
 while(1)
 {
 caca_event_t ev;
 int ret = caca_get_event(dp, caca_event_any, &ev, -1);
 if(!ret)
 	continue;

 if(caca_get_event_type(&ev) & caca_event_mouse_motion)
  {
	
	x=caca_get_event_mouse_x(ev);
	y=caca_get_event_mouse_y(ev);

  }

  caca_refresh_display(dp);
  cucul_put_str(cv, x,y, "lo0o00oo0ol");
}
 caca_free_display(dp);
  return 0;

}

miky@tux ~ $ gcc `pkg-config --libs --cflags cucul caca` example.c -o example
example.c: In function 'main':
example.c:21: warning: incompatible implicit declaration of built-in
function 'printf'
example.c:28: warning: incompatible implicit declaration of built-in
function 'printf'
/tmp/ccwdvZ7X.o: In function `main':
example.c:(.text+0x110): undefined reference to `caca_get_event_type'
example.c:(.text+0x13e): undefined reference to `caca_get_event_mouse_x'
example.c:(.text+0x168): undefined reference to `caca_get_event_mouse_y'
collect2: ld returned 1 exit status

uff :( thanks in advance, i'm a newbie of libcaca

--
Michele
http://newmainframe.wordpress.com
-- 
This is the libcaca mailing-list, see http://libcaca.zoy.org/
Trouble unsubscribing? Please contact <sam@zoy.org>
List archives are at http://libcaca.zoy.org/list/