You must tell GCC where it can find A.) any needed libraries that are outside the standard paths, and B.) any needed include files that are outside the standard paths. Unless you wish to invoke the linker or the pre-processor directly, in which case you have to tell them instead of the gcc front end, respectively.