using mingw gcc to compile under Cygwin

5 views (last 30 days)
Daniel Lovall
Daniel Lovall on 30 May 2017
Edited: Daniel Lovall on 30 May 2017
I want to use the mat file API to read mat files into some existing C code that runs under Cygwin, but I can't compile the example code supplied with my Matlab distribution. I am trying to compile matdgns.c to run under Cygwin. I can compile the code under Linux on another machine, and I can compile matdgns.c to run from the Windows 10 command prompt using mex and the Mingw gcc compiler. I tried using the same gcc command (modifying the paths, of course) that I used on Linux and Windows, but I get the following error when I try to do that:
matdgns.c:24:17: fatal error: mat.h: No such file or directory compilation terminated.
I've checked, and mat.h exists in the library location I am pointing to.
Here is my gcc command:
/cygdrive/c/TDM-GCC-64/bin/gcc -c -DTARGET_API_VERSION=700 -DUSE_MEX_CMD -m64 -I"/cygdrive/c/MATLAB/R2017a/extern/include" -I"/cygdrive/c/MATLAB/R2017a/simulink/include" -I"/cygdrive/c/MATLAB/R2017a/extern/lib/win64/mingw64" -fexceptions -fno-omit-frame-pointer -O -DNDEBUG matdgns.c -o matdgns.obj
I'm running R2017a, but have tried this under R2016a, with similar results. Is it possible to do what I'm attempting? How can I successfully compile?

Answers (0)

Community Treasure Hunt

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

Start Hunting!