我刚刚下载了Mosek库并尝试将其添加到我的项目中。我按照API中的所有步骤操作,并设法使用提供的Makefile
运行lo1示例INCPATHS=-I../../platform/osx64x86/h -I.
LIBPATHS=-L../../platform/osx64x86/bin
MOSEKLIB=-lmosek64
CCOPT=
LDOPT=-Wl,-rpath,@loader_path/../../platform/osx64x86/bin -pthread -lSystem -lm -Xlinker -bind_at_load
CC=gcc -m64
LD=gcc -m64
lo1: lo1.c
$(CC) -c $(INCPATHS) $(CCOPT) -o lo1.o lo1.c
$(LD) $(LIBPATHS) lo1.o $(MOSEKLIB) $(LDOPT) -o lo1
install_name_tool -change @loader_path/libmosek64.7.1.dylib ../../platform/osx64x86/bin/libmosek64.7.1.dylib lo1
现在,当我想构建我的Xcode项目时,我收到错误:
dyld: Library not loaded: @loader_path/libmosek64.7.1.dylib
Referenced from: /Users/John/Library/Developer/Xcode/DerivedData/quantstrat-cetdhtrlbbvomigzrlcbzwxogqwy/Build/Products/Debug/quantstrat
Reason: image not found
我以前已经添加了库,所以这就是我的进展方式:
我整天都在检查网络,我认为我缺少的是MakeFile中的install_name_tool。我应该更改什么设置才能让Xcode知道库的位置?
谢谢, 约翰