Compile/Run icc with cairo

Compile/Run icc with cairo

Hi all,

I've tried icc 10.1 Pro with cairo ( )

the installation went smooth as follows:

CentOS 5.
[vuhung@aoclife cairo]$ uname -r
[vuhung@aoclife cairo]$ rpm -qa | grep glibc
[vuhung@aoclife cairo]$

yum install
tar xvzf l_cc_p_10.1.008.tar.gz
cd l_cc_p_10.1.008
#serial number: VJFV-MP9H3R5J
cat "source /opt/intel/cc/10.1.008/bin/" >> ~/.bash_profile

icc now can run.


cd ~/usr/src/cairo-1.4.10
./configure --without-xlib --disable-xlib CC=icc
make install

And when I tried to compile icc with cairo ( hello.c ):

icc -o hello `pkg-config --cflags --libs cairo` hello.c

I got the error:

icc -o hello `pkg-config --cflags --libs cairo` hello.c
/tmp/icck8ycA8.o: In function `main':
hello.c:(.text+0x1c): undefined reference to `cairo_image_surface_create'
hello.c:(.text+0x24): undefined reference to `cairo_create'
hello.c:(.text+0x80): undefined reference to `cairo_move_to'
hello.c:(.text+0x91): undefined reference to `cairo_destroy'
hello.c:(.text+0xa2): undefined reference to `cairo_surface_destroy'


[vuhung@aoclife cairo]$ pkg-config --cflags --libs cairo
-I/usr/local/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -L/usr/local/lib -lcairo

Yes, icc couldn't find some API. Because I am new to icc, I don't know how icc creates and links the libraries.

If in the steps above, I replace icc with gcc, everything will be fine.

-----------cut here ------------

main (int argc, char *argv[])
cairo_surface_t *surface;
cairo_t *cr;

surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
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 0;


1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.