OPTION A) change lib path
- Find the application running by using
ps ax | grep <appname>
- Do
otool -L <full-path-of-app>
, this will give you dylib
your app resolves to
- Change the
dylib
in your binary using install_name_tool. Check this answer for more details to point to dylib
used by QT creator.
OPTION B) [un]/set RPATH
Another reason your app is using incorrect path could be RPATH
on your dylib
. You can check RPATH
on your dylib using otool -l <full-path-of-your-app>
. RPATH tells you the location binary will first pick up libraries from, if it is set in your application you can unset RPATH
set by QT creator.
Check man page of dyld to find out how does RPATH
work.
For example check RPATH
set on Xcode app (your are looking for LC_RPATH
field in dylib section).
$ otool -l /Applications/Xcode.app/Contents/MacOS/Xcode
Load command 22
cmd LC_RPATH
cmdsize 48
path @executable_path/../Frameworks (offset 12)
Load command 23
cmd LC_RPATH
cmdsize 56
path @executable_path/../SharedFrameworks (offset 12)
Load command 24
cmd LC_RPATH
cmdsize 40
path @executable_path/../PlugIns (offset 12)
To unset RPATH
use install_name_tool -delete_rpath <RPATH-from-otool-l-output>
QT creator typically uses libraries shipped with its package and on your target system these are typically not present. Better thing to do would be compile curl
and ship with your application