Search code examples
c++mingwmosek

Mosek C-API using MinGW


I try to build the 'lo1' Example for Mosek on MinGW. Unfortunately, it keeps returning undefined reference to ... I think I'm doing something wrong when linking the libraries. Anyone can help?

My build commands are the following:

g++ "-IC:\Program Files\Mosek\7\tools\platform\win64x86\h" "-LC:\Program Files\Mosek\7\tools\platform\win64x86\bin" -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -o "lo1.o" "lo1.cpp" "-lmosek64_7_1" 

g++ "-LC:\Program Files\Mosek\7\tools\platform\win64x86\bin" -static-libgcc -static-libstdc++ -o lo1.exe "lo1.o" "-lmosek64_7_1" 

Solution

  • g++ "-IC:\Program Files (x86)\Mosek\7\tools\platform\win32x86\h" -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -o "lo1.o" "lo1.cpp" 
    
    g++ "-LC:\Program Files (x86)\Mosek\7\tools\platform\win32x86\bin" -static-libgcc -static-libstdc++ -o lo1.exe "lo1.o" "-lmosek7_1" 
    

    Thanks for your answer. the problem happened while building. The 64bit version did not work. Mosek 32bit works with MinGW. Above build commands were used.