2

I just downloaded the Mosek library and tried adding it to my project. I followed all the steps from the API and I managed to run the lo1 example using the provided Makefile

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

Now when I want to build my Xcode project, I get the error:

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

I have already added libraries in the past so this is how i proceeded :

  1. In Build Phases I added the library to Link Binary With Libraries
  2. In Build Settings I added the path to Library Search Paths /Users/John/mosek/7/tools/platform/osx64x86/h
  3. In Build Settings I added the path to Header Search Paths /Users/John/mosek/7/tools/platform/osx64x86/bin

I have been checking the web all day and I think what I'm missing is the install_name_tool in the MakeFile. What setting should I change to let Xcode know where the library is located?

Thanks, John

  • 1
    Mosek does not have a `.../lib` folder. Instead, it has a `.../bin` folder with all the .dylib. I had made a mistake, headers are in `/Users/John/mosek/7/tools/platform/osx64x86/h` – JonathanLeblanc May 23 '16 at 15:50

0 Answers0