Search code examples
c++mysqleclipseeclipse-cdtubuntu-12.04

Eclipse, C++ and Mysql


I am reading the follow article Developing MySQL Applications with Eclipse CDT. My Eclipse version is Indigo and my Ubuntu version is 12.04. When I trying build I get the following errors:

/usr/bin/ld: cannot find -lz.a
/usr/bin/ld: cannot find -lmysqlclient.a

I like please get help. I searched mysqlclient.a and z.a libraries but not found these. But I found libmysqlclient.a and libz.a in directory /usr/lib/x86_64-linux-gnu then I add this Library search path but get the error.

How I will be able to fix this?


Solution

  • You passed z.a and mysqlclient.a as libraries. You need to ditch the .a suffix in your project's build settings: it's not part of the library's name. It should be -lz and -lmysqlclient.

    Also, adding the library search path (-L) is probably not necessary. /usr/lib and /usr/lib/$arch$ are usually in the default search paths.