1

I've configured the cairo libraries and mingw in netbeans as shown below enter image description here and this is my code

#include <stdio.h>
#include <stdlib.h>
#include <cairo.h>

int main(int argc, char** argv) 
{
printf("Hola mundo");
cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
    cairo_t *cr = cairo_create (surface);
    cairo_select_font_face (cr, "serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    cairo_set_font_size (cr, 32.0);
    cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);
    cairo_move_to (cr, 10.0, 50.0);
    cairo_show_text (cr, "Hello, world");
    cairo_destroy (cr);
    cairo_surface_write_to_png (surface, "hello.png");
    cairo_surface_destroy (surface);
return (EXIT_SUCCESS);
 }

so when I try to build I get the following error:

 undefined reference to cairo_image_surface_create
 undefined reference to cairo_create
 undefined reference to cairo_select_font_face
 undefined reference to cairo_set_font_size
 undefined reference to cairo_set_source_rgb
 undefined reference to cairo_move_to
 undefined reference to cairo_show_text
 undefined reference to cairo_destroy
 undefined reference to cairo_surface_write_to_png
 undefined reference to cairo_surface_destroy

how I can configured the netbeans to build fine?

Premier
  • 766
  • 2
  • 10
  • 20
  • It would seem you forgot to add the appropriate library to the *linker* settings. [Read this](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix). – WhozCraig Jul 06 '15 at 14:11

0 Answers0