gcc wont compile and run MySQL C libraries

后端 未结 7 743
不知归路
不知归路 2021-02-03 14:20
#include 
#include 

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

7条回答
  •  无人共我
    2021-02-03 14:51

    It is not a compilation error. It is a link error.

    Add the mysql library to create your executable with option -lmysql should do the trick.

提交回复
热议问题