When developers get tired of entering gcc/g++ on the command line with many options, they then to employ the use of a Makefile.
However, since I understand that this query is related to our earlier discussion, I'll instruct you how to add /usr/local/lib (or any other location) to the system's library cache.
All of the following steps require admin privileges; if you don't have them on your system then there's no point reading any further. To start...
P.S. I do not have access to my Kubuntu system at the moment; the path to the library cache configuration files (/etc/ld.so.conf.d) may be different on your particular system. Right now my only reference is a Fedora 16 system.
# Elevate privileges
# Goto the location where library cache configuration files are stored
# Create a new file specifying /usr/local/lib
echo /usr/local/lib > local.conf
# Update the system's library cache
# log out
I have access to my (K)ubuntu system, and have verified that the path, /etc/ld.so.conf.d, is correct. There should be a file in that directory called 'libc.conf' containing the path /usr/local/lib. If this is true on your system, then disregard the instructions given above. There should be no need to augment the system's library path any further, since what you require will already be there. In case I'm wrong, just run "sudo ldconfig" to update the cache.