MEX MySQL Database Connector on ubuntu x86_64 - libmysql.so.16: cannot open shared object file

2 ビュー (過去 30 日間)
Hi All,
I have been having a problem to compile mysql.cpp on ubuntu x86_64.
I downloaded the libraries and I compile mysql.cpp with the following command:
mex -v -g -Ipath/include -Lpath/lib -lmysqlclient mysql.cpp
It seems it works and creates the file: mysql.mexa64.
However, when I try to run mysql.mexa64 in matlab, I get the following error:
??? Invalid MEX-file 'mysql.mexa64': libmysql.so.16: cannot open shared object file: No such file or directory.
My linux version is: Linux 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011 x86_64 GNU/Linux and my matlab version is: MATLAB Version 7.9.0.529 (R2009b)
Can anyone help me?
  2 件のコメント
Kaustubha Govind
Kaustubha Govind 2011 年 2 月 17 日
Is path to libmysql.so on LD_LIBRARY_PATH?
Antonio
Antonio 2011 年 2 月 17 日
When I type on linux terminal:
echo $LD_LIBRARY_PATH
it returns a blank line.
If I type on matlab terminal
!echo $LD_LIBRARY_PATH
It returns several paths, but none of them where libmysql.so is.
I tried to add the path doing
!LD_LIBRARY_PATH=$LD_LIBRARY_PATH":path/libmysql.so", but it didn't work.
How can I add a new path to LD_LIBRARY_PATH?
Or, should I create a link from one of the paths in LD_LIBRARY_PATH to libmysql.so?

サインインしてコメントする。

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 9 月 17 日
Antonio wrote in comment:
_I got it working.
It was simpler than I thought.
I just typed on the terminal
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:my_path
where my_path is the path for mysql library.
Nothing better than sleep and try it again on the next day.
Thanks a lot for the help.
_

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by