I installed a library for programming. How do I remove it?
First off, there's likely no harm in leaving the library installed on your system. It doesn't consume any processor or memory resources by itself (though it does take up some small amount of disk storage space).

My assumption is that you've installed the g2 library into default locations. According to the g2 website, the following files were installed:


libg2.a (may be called libg2.so or libg2.dylib on your particular flavor of OS)
g2.h
g2_X11.h
g2_GIF.h
g2_PS.h


The first file, the executable code, should've been installed into /usr/lib or /usr/local/lib. The rest — header files for development — should've been installed into /usr/include or /usr/local/include. To 'uninstall' the library, just delete the files in the above list from these paths.