Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 10329  / 2 Years ago, thu, january 20, 2022, 2:37:25

I have the following code



#include <my_global.h>
#include <mysql.h>

int main(int argc, char **argv)
{
printf("MySQL client version: %s
", mysql_get_client_info());

exit(0);
}


when i try to compile it using



gcc mysqldb.c -o mysql -I/usr/include/mysql -lmysqlclient 


i get an error saying fatal error mysql.h:No such file or directory. how can i successfully compile and run the code


More From » compiling

 Answers
2

Check that /usr/include/mysql/mysql.h exists. If you have installed the header files somewhere else (say /opt/mysql/include), add that location with -I/opt/mysql/include.


[#27756] Thursday, January 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aslity

Total Points: 336
Total Questions: 133
Total Answers: 98

Location: Zimbabwe
Member since Thu, Jul 21, 2022
2 Years ago
;