how to link without using ld -rpath

Hello,
I'm tryign to compile a sample code which uses OTL(Oracle, Odbc and DB2-CLI Template Library Programmer's Guide). I get this error while compiling the source file:

[hd@mahzen otl]$ g++ foo.cpp -o foo -I /tmp/  -I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/rdbms/public -L$ORACLE_HOME/lib/ -lclntsh
/usr/bin/ld: warning: libnnz10.so, needed by /usr/lib/oracle/xe/app/oracle/product/10.2.0/server//lib//libclntsh.so, not found (try using -rpath or -rpath-link)

libnnz10.so exists in the -L path but it complains about it.
I can't understand how to use -rpath or -path-link. I do not link the files with ld, so how can I use these options? In man page of g++ there is not an option named 'rpath'. Is it possible to pass an option to g++ to do the same thing?

Thanks.

---------- Post updated 03-17-10 at 08:10 AM ---------- Previous update was 03-16-10 at 05:28 PM ----------

Hello,
I've solved the problem.
Adding -lnnz10 is needed to link correctly.