How to compile from a linux command line matreadstructarray.c using gcc?

I'd like to compile from the command line one of the sample files, but I receive the following error when I do so. (I copied matreadstructarray.c' to my 'c' folder). Any help would be appreciated. Thanks.
<179 pebble2:~/c > *gcc -o a.out matreadstructarray.c -I "/soft/linux/matlab2017b/extern/include"*
/tmp/ccjtgFoj.o: In function `analyzestructarray':
matreadstructarray.c:(.text+0x21): undefined reference to `mxGetNumberOfElements'
matreadstructarray.c:(.text+0x46): undefined reference to `mxGetField'
matreadstructarray.c:(.text+0x5d): undefined reference to `mxGetClassID'
matreadstructarray.c:(.text+0x6e): undefined reference to `mxIsComplex'
matreadstructarray.c:(.text+0x7e): undefined reference to `mxGetPr'
/tmp/ccjtgFoj.o: In function `findstructure':
matreadstructarray.c:(.text+0xf5): undefined reference to `matOpen'
matreadstructarray.c:(.text+0x133): undefined reference to `matGetVariable'
matreadstructarray.c:(.text+0x16a): undefined reference to `mxGetClassID'
matreadstructarray.c:(.text+0x182): undefined reference to `mxGetFieldNumber'
matreadstructarray.c:(.text+0x1d6): undefined reference to `mxDestroyArray'
matreadstructarray.c:(.text+0x1e2): undefined reference to `matClose'
collect2: error: ld returned 1 exit status
<180 pebble2:~/c >

Catégories

En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by