Bug #76524 Manual page on building clients update
Submitted: 30 Mar 2015 8:04 Modified: 16 Apr 2015 15:46
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:Any OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[30 Mar 2015 8:04] Roel Van de Paar
Description:
https://dev.mysql.com/doc/refman/5.6/en/c-api-building-clients.html

Specifies how to build statically and dynamically on Windows. It does not do so for Linux. When using -L... -lmysqlclient it looks like dynamic linking of the mysql client is done. 

How to repeat:
Try to compile dynamically/statically.

Suggested fix:
It would be good if the text could explain how to do static linking (likely by specifying the libmysqlclient.a directly in the command without the -L/-l options?)
[30 Mar 2015 15:54] MySQL Verification Team
Thank you for the bug report.
[16 Apr 2015 15:46] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.

Roel, good guess. I'll update the page as follows:

On Unix, linking uses dynamic libraries by default. To link to the static client library instead, add its path name to the link command. For example, if the library is located in /usr/local/mysql/lib, link like this:

shell> gcc -o progname progname.o /usr/local/mysql/lib/libmysqlclient.a

Or use mysql_config to provide the library name:

shell> gcc -o progname progname.o `mysql_config --variable=pkglibdir`/libmysqlclient.a