gcc wont compile and run MySQL C libraries

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

    Maybe late but worked for me
    If you are using an IDE you should link the library to your project.
    I am using CodeBlocks on ubuntu 12.4 64x. For linking the library, you should go to Project -> Build options -> linker settings and add the library. this is my lib path : /usr/lib/x86_64-linux-gnu/libmysqlclient.so

    Hope be useful...

提交回复
热议问题