gcc wont compile and run MySQL C libraries

后端 未结 7 780
不知归路
不知归路 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:46

    You forgot to link against the MySQL library. Try adding -lmysql to your compilation line.

    See http://www.adp-gmbh.ch/cpp/gcc/create_lib.html for more information.

提交回复
热议问题