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

3 次查看(过去 30 天)
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 >

回答(1 个)

Darshan Ramakant Bhat
I found the similar issue being discussed in the below MATLAB answer post:
I hope this will help you.

类别

Help CenterFile Exchange 中查找有关 Application Deployment 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by