Re: /usr/bin/ld cannot locate libmysqlclient, when it is there
- From: "Nils O. Selåsdal" <noselasd@xxxxxxxxxxxxxxxxxxxxx>
- Date: 31 Mar 2006 18:23:46 +0100
saurabh wrote:
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.
The compiler does not know about VPATH. It needs to be told,
via -L flags, where to look for libraries not in the standard
library search path.
VPATH is for instructing 'make' where to search for dependencies.
.
- References:
- Prev by Date: Re: redirection operator
- Next by Date: Re: Thread behaviour using pthread
- Previous by thread: Re: /usr/bin/ld cannot locate libmysqlclient, when it is there
- Next by thread: redirection operator
- Index(es):
Relevant Pages
|