View topic - gf_dev_attach()????

gf_dev_attach()????

General Help about QNX

gf_dev_attach()????

Postby CMLDMR » Sun Apr 11, 2010 9:26 pm

Image

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
Attachments
tut1_gf error.jpg
(129.71 KiB) Downloaded 27 times
CMLDMR
Active Member
 
Posts: 27
Joined: Sun Mar 21, 2010 4:51 pm

RE: gf_dev_attach()????

Postby qnxloader » Mon Apr 12, 2010 4:47 am

add in linker options "-lgf"
qnxloader
Senior Member
 
Posts: 206
Joined: Mon Oct 06, 2003 8:29 am

RE: gf_dev_attach()????

Postby CMLDMR » Mon Apr 12, 2010 9:37 am

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




Code: Select all
#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;
}
Image
CMLDMR
Active Member
 
Posts: 27
Joined: Sun Mar 21, 2010 4:51 pm

RE: gf_dev_attach()????

Postby CMLDMR » Mon Apr 12, 2010 5:55 pm

Resolved Problem,

if have this I can write Solution.
CMLDMR
Active Member
 
Posts: 27
Joined: Sun Mar 21, 2010 4:51 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron