views:

216

answers:

1

Invoking: Cygwin C++ Linker g++ -nostartfiles -L"E:\cygwin\lib\mysql\lib" -lmysqlclient -lz -shared -o"final.so" ./src/one.o ./src/two.o ./src/three.o ./src/four.o ./src/five.o
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status

+1  A: 

The error message states that the mysqlclient library cannot be found. Since you're using Cygwin the issue might be that you're using a Windows-style path -L"E:\cygwin\lib\mysql\lib". I believe the GNU C++ Linker expects a Unix-style path, such as -L"/lib/mysql/lib".

Without more specific information it's hard to say though.

Erik Edin
@ERIK Some more details >libmysqlclient.so is present under E:\cygwin\lib\mysql\lib n somehow that is not getting linked properly.I dont think its path prb coz compilation phase excuted properly with the same path.can u plz tell how to do it
rupali
Under Project->properties->C++ Build->settings->Cygwin c++ Linker->LibrariesAdded following Libraries (-l) mysqlclient.soLibrary search path (-L)E:\cygwin\lib\mysql\lib
rupali
I don't think g++ tries to use the -L paths during compile phase, so you won't notice the problem there.
Erik Edin
so any other suggestions?
rupali
Cygwin won't pay attention to e:\\. Use /cygdrive/e/...
bmargulies
Even after path changes ----> Building target: final.so Invoking: Cygwin C++ Linker g++ -o"final.so" ./src/one.o ./src/two.o ./src/three.o ./src/four.o ./src/five.o -nostartfiles -L/cygdrive/e/cygwin/usr/local/lib -lmysqlclient -lz -shared /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status make: * [final.so] Error 1
rupali