My C is rather rusty, but I think you are a bit confused about how all this works.
First of all, the -static switch doesn't create static libraries. From GCC(1):
Code:
-static
On systems that support dynamic linking, this prevents linking with the shared libraries.
On other systems, this option has no effect.
In other words, -static
prevents the compiler from doing any dynamic linking. So obviously, even if your system could find mysqlclient library, you still wouldn't be able to link to it.
Second, if you are trying to create a static library (.a archive) you won't be dynamically linking to any library. That's up to the person who eventually compiles a binary. For example, he might want to compile in your library statically but also compile in the mysqlclient library statically. You can't decide that for him. Here's one tutorial on creating static libraries:
http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
Here is another article on creating binaries with mixed static/dynamic linking:
http://frigidcode.com/documentation/...c-linking.html
Thirdly, even if you did need to dynamically link to libmysqlclient, the reason is clear from the error message: the compiler can't find it. Probably it is installed in some place outside your normal library path. It's not installed on my system right now, but one google link suggested it would be in the /usr/lib/mysql directory. However, if you need more help with dynamic linking, just post some more and let us know.