How to make #include <mysql.h> work?

I am creating an open source project from a source,

and you need to enable <mysql.h>:

#if USE_MYSQL
#include <mysql.h>
#endif

and the compiler reports:

mysql.h no such file or directory

MySQL is another open source project, what do I need to do to make it work?

+5
source share
5 answers

This will depend entirely on your build methods, whether using an IDE such as Visual Studio, Eclipse, etc., or if you use shell scripts and command lines in * nix.

You need to make sure that this file (mysql.h) exists in your include path.

For example, in Visual Studio, you go to:

→ → C/++ → →

, "mysql.h".

, , DLL/LIB

, . .

+6

, Ubuntu 12.04, include

#include <mysql/mysql.h>
+6

include ?

+1
#include  "path-spec"
#include  <path-spec>

include. - , , .

#include "path-spec" include , #include, , (#include) . , /I, , INCLUDE.

#include <path-spec> , /I, , INCLUDE.

, , libs:

g++ bla.cpp -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient_r
+1
source

g ++ -o Program name $ (mysql_config --cflags) Programfile.cpp $ (mysql_config --libs)

Is there a trick in Linux.

0
source

All Articles