/usr/bin/ld cannot locate libmysqlclient, when it is there



Hi all,

I am working on a c++ application, porting it from solaris 8 to linux
9, using gcc version 3.4.3 20050227.

I am getting error of;
---------------------------------
c++ -g ----followed by other .o files ----- -lmysqlclient -o
.../../myapp
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [../../myapp] Error 1
--------------------------------

I am using a makefile to compile and build the application... some of
the makefile details (relevant) are as below;
----------------------------------
SRCPATH = ..
FORMATSRCPATH = ../../../myapp1/src
MYSQLPATH = ../../../../thirdparty/mysql
MYSQLLIBS = $(MYSQLPATH)/lib/mysql

VPATH = $(SRCPATH):$(FORMATSRCPATH):$(MYSQLLIBS)

CC = c++
CFLAGS = -g
CPPFLAGS = $(DEFS) $(PATHS)

PATHS = \
-I$(SRCPATH) \
-I$(FORMATSRCPATH) \
-I$(MYSQLPATH)/include/mysql

$(TARGETNAME): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -lmysqlclient -o $(TARGETNAME)

-------------------------------------------
If i append the "-lmysqlclient" with "-L$(MYSQLLIBS)" it builds fine,
but i am not getting why it is not being picked up from the VPATH.

All other directory paths are being picked up from VPATH(i've verified
that), as commenting VPATH or changing it gives complication error.

Please help!!!!

Regards,
Saurabh

.