How do I set the static library path in OS X Lion? Instead of typing :

g++ functions.cpp  /opt/local/lib/libhdf5.a /opt/local/lib/libsiloh5.a  /opt/local/lib/libz.a


I would prefer to type:

g++ functions.cpp  -lhdf5 -lsiloh5 -lz


I think that I need to add /opt/local/lib (Macports lib install location) to my library path. I have tried:

export LIBRARY_PATH="/opt/local/lib"
export LD_LIBRARY_PATH="/opt/local/lib"
export LD_LIBRARY_PATHS="/opt/local/lib"


None work
The normal command line is to use the -L option to add the path to the library search

g++ functions.cpp -L/opt/local/lib -lhdf5 -lsiloh5 -lz