centos7 /usr/bin/ld: cannot find -lmysqlclient

centos7编译c程序报错:

[cpp] view plain copy
  1. /usr/bin/ld: cannot find -lmysqlclient  


[plain] view plain copy
  1. 原因:libmysqlclient.so不在/usr/lib目录下,而是在/usr/lib64/mysql目录下  
  2. 解决:建一个软连接或者复制到/usr/lib目录下  
  3. cp -r /usr/lib64/mysql/* /usr/lib/ 

你可能感兴趣的:(centos7 /usr/bin/ld: cannot find -lmysqlclient)