与MAC OS X 10.6的MySQL C API编译问题 [英] Compile Problem with MySQL C API on MAC OS X 10.6
问题描述
我有一个问题与MySQL C API和Mac OS X 10.6。当我想编译SQL客户端程序,它与此错误消息中止
i've a Problem with MySQL C API and Mac OS X 10.6. When i want to compile a SQL Client Program, it aborts with this Error Message
LD:找不到-lmysqlclient库
ld: library not found for -lmysqlclient
collect2:LD返回1退出状态
collect2: ld returned 1 exit status
我用此命编译:
G ++ -I在/ usr /本地/ MySQL的/有/ -L在/ usr /本地/ MySQL的/ lib目录/ -lmysqlclient的main.cpp
g++ -I /usr/local/mysql/include/ -L /usr/local/mysql/lib/ -lmysqlclient main.cpp
我试过在不同地点的页眉和图书馆的 - 无影响
我已经下载从其他目的地的头和图书馆 - 像以前一样的效果。
I've tried the Headers and Librarys in different locations - no effect I've downloaded the headers and the Library from an other Destination - Same effect as before
任何想法我做错了什么?
如果有一个线程媒体链接,我想原谅(在搜索中找到什么)!
Any Ideas what i am doing wrong? If there is a thread allready i want to excuse (nothing found in search)!
问候,丹尼斯
推荐答案
所以经过多天,没有紧张的工作中;-)这里的故障:
如果是在标准的安装目录,编译器不接受库。我复制了包含和lib文件到的/ usr /本地/包括
和的/ usr / local / lib目录
。现在,它编译没有错误: - )
So after many days, of not intensive work ;-) here's the fault:
the compiler doesn't accept the library if it is in the standard install directory. I copied the include and lib files into /usr/local/include
and /usr/local/lib
. Now it compiles without errors :-)
我不知道为什么它只能在标准的路径,但现在却它的工作原理。
I don't know why it only works in the standard paths but however now it works.
丹尼斯
这篇关于与MAC OS X 10.6的MySQL C API编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!