tut1_GF.c:(.text+0x27): undefined reference to `gf_dev_attach’
in the help file example giving an error this.
Why can’t I compile that?
help me please? lütfen
tut1_GF.c:(.text+0x27): undefined reference to `gf_dev_attach’
in the help file example giving an error this.
Why can’t I compile that?
help me please? lütfen
add in linker options “-lgf”
in help file I am going well when I meet to create and surface section.
Whay create layer failed and
What is that " Memory fault"
Codes and screen are below
[color=red][code]#include <stdlib.h>
#include <stdio.h>
#include <gf/gf.h>
int main(int argc, char *argv[]) {
gf_dev_t gdev;
gf_dev_info_t gdev_info;
gf_display_t display;
gf_display_info_t display_info;
gf_surface_t surface;
_uint16 width = display_info.xres;
_uint16 height = display_info.yres;
gf_layer_t layer;
gf_context_t * context;
unsigned main_layer_index;
//gf_dev_attach
if (gf_dev_attach(&gdev, GF_DEVICE_INDEX(0), &gdev_info) != GF_ERR_OK) {
printf("gf_dev_attach() failed\n\n");
return (-1);
} else {
printf("SUCCESS gf_dev_attach()\n\n");
}
printf("Number of displays: %d\n",gdev_info.ndisplays);
if (gf_display_attach(&display, gdev, 0, &display_info) == GF_ERR_OK) {
printf("Resolution = %d * %d, refresh = %dHz\n", display_info.xres,
display_info.yres, display_info.refresh);
printf("Number of layers: %d\n", display_info.nlayers);
} else {
printf("gf_display_attach() failed\n");
}
//**************************************************
if (display != NULL) {
if (gf_layer_attach(&layer,
display, 0, 0) == GF_ERR_OK) {
printf("layer attach SUCCESS\n\n");
} else {
printf("gf_layer_attach() failed\n");
}
}
//
// ***********************************************
if (gf_surface_create_layer(&surface, &layer, 1, 0,
width, height, 0, NULL, 0) == GF_ERR_OK) {
gf_layer_set_surfaces(layer, &surface, 1);
/* draw stuff here */
gf_context_set_fgcolor(context, 0xFFFFFF);
gf_draw_rect(context,10,10,50,50);
gf_context_set_fgcolor(context, 0x000000);
gf_draw_rect(context,20,20,40,40);
} else {
printf("gf_surface_create_layer() failed\n");
}
if (gf_context_create(&context) != GF_ERR_OK) {
fprintf(stderr, "gf_context_create failed\n");
return -1;
}
if (gf_context_set_surface(context, surface) != GF_ERR_OK) {
fprintf(stderr, "gf_context_set_surface failed\n");
return -1;
}
int d;
scanf("%d",&d); //for wait screen
return EXIT_SUCCESS;
}
[/code]
Resolved Problem,
if have this I can write Solution.