标签:
gcc命令
gcc -I /usr/local/mysql/include mysqlVersion.c -o demo -L /usr/local/mysql/lib -lmysqlclient
--I /usr/local/mysql/include:把/usr/local/mysql/include作为第一个寻找头文件的目录,寻找的顺序是/usr/local/mysql/include-> /usr/include -> /usr/local/include
-L /usr/local/mysql/lib :表示把/usr/local/mysql/lib 作为第一个寻找库文件的目录,寻找顺序为:/usr/local/mysql/lib -> /lib -> /usr/lib -> /usr/local/lib
-lmysqlclient:表示在上面的lib路劲中寻找libmysqlclient动态库文件(如果gcc编译选择中加入了"static"表示寻找libmysqlclient.a静态库文件)cd
标签:
原文地址:http://my.oschina.net/u/1179666/blog/495638