What compilation flags are required to compile that code?
You will need to instruct the compiler where to find the cairo.h file, (generally something like -I /usr/include/cairo), and tell the linker where to find the cairo library and to link with it, (often something like -L /usr/lib -lcairo). But the exact flags and paths will depend on your compiler and your installation of cairo. To simplify this, cairo uses pkg-config which can help you determine the correct flags to use. If you have pkg-config installed, then you can compile the above hello.