fatal error mysql.h:No such file or directory during compilation

前端 未结 4 848
滥情空心
滥情空心 2021-01-18 14:47

I have the following code

#include 
#include 

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


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-18 15:05

    I had the same problem, but fortunately the command sudo apt install libmysqlclient-dev as specified by user4713908 fixed it.

    I juat had to specify the path in my makefile as

    gcc -o database1 chapter5_1.c -I/usr/include/mysql
    

    I'm using Kali Linux

提交回复
热议问题