0

I'm trying to use those libs provided by matlab R2014b. I've already got executable file main.out but this error occurs when it runs: error

Here's my .bash_profile, I've done some search job but most of them got this error when using Xcode while I use g++ and makefile to generate compile my project:

.bash_profile

I've already write the $DYLB_LIBRARY_PATH but it still not working.

(Sorry this is my first time to ask question in stackoverflow. If there's anything unproper ,please forgive.)

  • You need to find out what the "runpath" is set to in the executable as that is where it's looking for the library (hint: the `@rpath` bit). [This question](http://stackoverflow.com/questions/12521802/print-rpath-of-executable-on-osx) will show you how. – trojanfoe May 05 '16 at 14:50
  • After trying this, I find the reason maybe is I haven't include the right lib. I just link libmwmclmcrrt while it requires libmwmclmcrrt.8.4. But when I wrote this `g++ *.o -L/Applications/MATLAB_R2014b.app/bin/maci64 -lmwmclmcr.8.4`. The compiler still can't find the library while the library do exist in that path. So how can I specific the version of the dynamic lib while using g++ command? – i4never May 06 '16 at 02:03
  • I don't think you'd normally bother; if you look in that matlab lib directory you'll probably find the related libraries are symlinked. The issue is probably that the library has an *install name* which includes `@rpath` which forces executables linking with the library to set their runpath. You need to set the `-rpath` of the linker which requires the compiler flags `-Wl,-rpath -Wl,/Applications/MATLAB_R2014b.app/bin/maci64`. – trojanfoe May 06 '16 at 08:22

0 Answers0