Can't compile c file using mex

4 views (last 30 days)
José Pedro Carvalho
José Pedro Carvalho on 13 Nov 2017
Good afternoob guys. I've done tons os research here and kinda lost the past 2 days trying to solve my issue before creating probably a repeted topic but didn't have success. I'm trying to compile a C script that I've done but I'm having the following message:
Error using mex C:/ProgramData/MATLAB/SupportPackages/R2017b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\lib\gsl.lib when searching for -lgsl C:/ProgramData/MATLAB/SupportPackages/R2017b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/ProgramData/MATLAB/SupportPackages/R2017b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/lib/../lib\gsl.lib when searching for -lgsl C:/ProgramData/MATLAB/SupportPackages/R2017b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/ProgramData/MATLAB/SupportPackages/R2017b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/lib\gsl.lib when searching for -lgsl C:/ProgramData/MATLAB/SupportPackages/R2017b/3P.instrset/mingw_w64.instrset/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgsl collect2.exe: error: ld returned 1 exit status
The line I'm trying to run is:
mex file.c -I'C:\Program Files (x86)\Dev-Cpp\MinGW64\include\' -L'C:\lib\' -lgsl
where my gsl files with .h extensions are in "C:\Program Files (x86)\Dev-Cpp\MinGW64\include\" and the gsl.lib is in "C:\lib\"
I've tried TONS of different things. I had plenty of issues untill this point. I've reinstalled gsl, tried to compile via gcc and many other things. So if this is a repeated topic I really do apologize in advance! But I used a lot of things found here to fix previous erros as I mentioned.
Any help would be really awesome. Thank you very much!

Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!