Search the MySQL manual:

9.1.15.2 Compiling Programs with libmysqld

To get a libmysqld library you should configure MySQL with the --with-embedded-server option.

When you link your program with libmysqld, you must also include the system-specific pthread libraries and some libraries that the MySQL server uses. You can get the full list of libraries by executing mysql_config --libmysqld-libs.

The correct flags for compiling and linking a threaded program must be used, even if you do not directly call any thread functions in your code.

User Comments

Posted by [name withheld] on Monday July 14 2003, @6:02am[Delete] [Edit]

You may need to include libwrap in order to compile a program. It wasn't present in the output of 'mysql_config --libmysqld-libs' on my system.

Add your own comment.