#include
#include
#include
int main (int argc, char *argv[])
{
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;
Setting -> Compiler and debugger -> Search directories -> Linker
then Add and insert /usr/lib/mysql/
compile your app with the command bellow
gcc -o test -L/usr/lib/mysql -lmysqlclient test.c
This is for Linux environments only:
In "Project build options" > "Linker settings" Tab > Under "Other linker options" add -lmysqlclient
You will also need to add mysql-connector-c-6.1.3-linux-glibc2.5-x86_64/include/ in "Search directories" > "Compiler"
You will also need to add mysql-connector-c-6.1.3-linux-glibc2.5-x86_64/lib/ in "Search directories" > "Linker"
For windows:
-lmysql
MySQL Connector library can be found here: http://dev.mysql.com/downloads/connector/c/