3

I wanted to use cairo library for c++ graphics. I included the libraries using

sudo apt-get install libcairo2-dev

and further I installed GLX-Dock(Cairo Dock with OpenGL) using Ubuntu open software center and used the code in http://cairographics.org/FAQ/ and compiled with command

g++ trial.cpp 

but it gives me the following error

fatal error: cairo.h: No such file or directory
compilation terminated.

How should i compile and run the file?

Moreover can someone recommend easy to learn graphics library with more features. I tried using OpenGL but found it difficult to understand.

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
Rajs123
  • 663
  • 13
  • 30
  • 2
    right after the code in the website it tells you how to compile. it's not `g++ trial.cpp` – Gir Aug 11 '12 at 22:53

2 Answers2

2

Read the FAQ again: http://cairographics.org/FAQ/#compilation_flags

This will get you started:

g++ test.c \`pkg-config --libs --cflags cairo\` -o test

Run it with:

./test
Adi Lester
  • 24,731
  • 12
  • 95
  • 110
1

I hope this Solution Works

sudo apt-get install libcairo2-dev

And then:

sudo npm install processing -g
ahmad735
  • 67
  • 9