[Qt-interest] Using MySQL Libraries on MAC
David Villalobos Cambronero
david.villalobos.c at gmail.com
Thu Sep 30 16:42:46 CEST 2010
Hi Samuel, many thanks for the reply, I changed the lib name and it did not
work.
I add these lines to my .pro file:
LIBS += -L/opt/local/lib/mysql5/ -lmysqlclient
INCLUDEPATH += /opt/local/include/mysql5/
And still got the same error, could you take a look, please.
Here is the dir contents:
/opt/local/lib/mysql5/mysql
macbook-de-admin:mysql admin$ ls -l
total 42856
-rw-r--r-- 2 root admin 728 Jan 23 2010 libdbug.a
-rw-r--r-- 2 root admin 68944 Jan 23 2010 libheap.a
-rw-r--r-- 2 root admin 424576 Jan 23 2010 libmyisam.a
-rw-r--r-- 2 root admin 56752 Jan 23 2010 libmyisammrg.a
-rwxr-xr-x 2 root admin 1404036 Jan 23 2010 libmysqlclient.16.dylib
-rw-r--r-- 2 root admin 1552576 Jan 23 2010 libmysqlclient.a
lrwxr-xr-x 1 root admin 23 Jan 23 2010 libmysqlclient.dylib ->
libmysqlclient.16.dylib
-rwxr-xr-x 2 root admin 1028 Jan 23 2010 libmysqlclient.la
-rwxr-xr-x 2 root admin 1410572 Jan 23 2010 libmysqlclient_r.16.dylib
-rw-r--r-- 2 root admin 1563192 Jan 23 2010 libmysqlclient_r.a
lrwxr-xr-x 1 root admin 25 Jan 23 2010 libmysqlclient_r.dylib ->
libmysqlclient_r.16.dylib
-rwxr-xr-x 2 root admin 1040 Jan 23 2010 libmysqlclient_r.la
-rw-r--r-- 2 root admin 11537436 Jan 23 2010 libmysqld.a
-rw-r--r-- 2 root admin 1291744 Jan 23 2010 libmystrings.a
-rw-r--r-- 2 root admin 307796 Jan 23 2010 libmysys.a
-rwxr-xr-x 2 root admin 889564 Jan 23 2010 libndbclient.3.dylib
-rw-r--r-- 2 root admin 1364468 Jan 23 2010 libndbclient.a
lrwxr-xr-x 1 root admin 20 Jan 23 2010 libndbclient.dylib ->
libndbclient.3.dylib
-rwxr-xr-x 2 root admin 976 Jan 23 2010 libndbclient.la
-rw-r--r-- 2 root admin 12944 Jan 23 2010 libvio.a
drwxr-xr-x 2 root admin 612 Jan 23 2010 plugin
macbook-de-admin:mysql5 admin$ cd mysql/
macbook-de-admin:mysql admin$ ls -l
total 864
-rw-r--r-- 2 root admin 4058 Jan 23 2010 decimal.h
-rw-r--r-- 2 root admin 3854 Jan 23 2010 errmsg.h
-rw-r--r-- 2 root admin 6954 Jan 23 2010 keycache.h
-rw-r--r-- 2 root admin 22690 Jan 23 2010 m_ctype.h
-rw-r--r-- 2 root admin 8256 Jan 23 2010 m_string.h
-rw-r--r-- 2 root admin 1804 Jan 23 2010 my_alloc.h
-rw-r--r-- 2 root admin 1941 Jan 23 2010 my_attribute.h
-rw-r--r-- 2 root admin 36558 Jan 23 2010 my_config.h
-rw-r--r-- 2 root admin 5558 Jan 23 2010 my_dbug.h
-rw-r--r-- 2 root admin 3460 Jan 23 2010 my_dir.h
-rw-r--r-- 2 root admin 3315 Jan 23 2010 my_getopt.h
-rw-r--r-- 2 root admin 52783 Jan 23 2010 my_global.h
-rw-r--r-- 2 root admin 1488 Jan 23 2010 my_list.h
-rw-r--r-- 2 root admin 3656 Jan 23 2010 my_net.h
-rw-r--r-- 2 root admin 1542 Jan 23 2010 my_no_pthread.h
-rw-r--r-- 2 root admin 26589 Jan 23 2010 my_pthread.h
-rw-r--r-- 2 root admin 40746 Jan 23 2010 my_sys.h
-rw-r--r-- 2 root admin 2677 Jan 23 2010 my_xml.h
-rw-r--r-- 2 root admin 33654 Jan 23 2010 mysql.h
-rw-r--r-- 2 root admin 20174 Jan 23 2010 mysql_com.h
-rw-r--r-- 2 root admin 1130 Jan 23 2010 mysql_embed.h
-rw-r--r-- 2 root admin 2097 Jan 23 2010 mysql_time.h
-rw-r--r-- 2 root admin 833 Jan 23 2010 mysql_version.h
-rw-r--r-- 2 root admin 23447 Jan 23 2010 mysqld_ername.h
-rw-r--r-- 2 root admin 23502 Jan 23 2010 mysqld_error.h
-rw-r--r-- 2 root admin 29104 Jan 23 2010 plugin.h
-rw-r--r-- 2 root admin 1957 Jan 23 2010 sql_common.h
-rw-r--r-- 2 root admin 12332 Jan 23 2010 sql_state.h
-rw-r--r-- 2 root admin 1006 Jan 23 2010 sslopt-case.h
-rw-r--r-- 2 root admin 2205 Jan 23 2010 sslopt-longopts.h
-rw-r--r-- 2 root admin 1107 Jan 23 2010 sslopt-vars.h
drwxr-xr-x 3 root admin 102 Jan 23 2010 storage
-rw-r--r-- 2 root admin 1501 Jan 23 2010 typelib.h
Regards
---
David
On Thu, Sep 30, 2010 at 02:05, Samuel Gaist <samuel.gaist at cinetis.ch> wrote:
> On 29 sept. 10, at 16:38, David Villalobos Cambronero wrote:
>
> Dear all,
>>
>> I'm trying to compile my app on MAC. It uses the MySQL Headers and
>> Libraries. I really new on MAC, but I think all the required files are
>> there, headers files are installed on /opt/local/include/mysql5/mysql;
>> library files are present on /opt/local/lib/mysql5/mysql. But when I try to
>> compile I got the error: library not found for -llibmysqlclient.a Both paths
>> are added to my .pro file.
>>
>> Any idea of what I'm doing wrong?
>>
>> Regards
>> ---
>> David
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
> Hello,
> You are using the wrong name it should be -lmysqclient, and don't forget
> that if you want to use the static version (it seems so looking at the
> library name you used) you should not have the the dynamic libraries in the
> same directories, they will be picked up by default by the linker.
> There are two solution for that:
> 1. Move the static version in another directory and point the linker to
> them (with -L)
> 2. Make a symbolic link to the library and use the name of that link: i.e.
> ln -s libmysqlclient.a libmysqlclient_s.a and in the pro file:
> -lmysqlclient_s
>
> Hope this helps
> Samuel
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100930/6aa02163/attachment.html
More information about the Qt-interest-old
mailing list