[Create mexfunction from C code] The order of several c files
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a c source code that consists of several .c files. How can I know the orders of these files when I build the mex function?
for example:
mex mainFun.c X.c Y.c Z.c
This is the source code:
I have got this error "Error using mex D:\TestMexFunction\unix_timer.c:22:26: fatal error: sys/resource.h: No such file or directory #include <sys/resource.h> ^
compilation terminated." when I run:
mex mainFun.c ants.c parse.c TSP.c dos_timer.c InOut.c ls.c unix_timer.c utilities.c
mainFun.c includes the mexFunction()
acotsp.c includes the main() function
Is it because of the order of c files or another reason?
0 comentarios
Respuestas (2)
James Tursa
el 20 de Sept. de 2019
Editada: James Tursa
el 18 de Abr. de 2023
The order you compile your source code files should not matter (other than the fact that the mex function name will be based on the first file listed unless you override that). The error seems to be that the compiler can't find the resource.h file.
2 comentarios
shdotcom shdotcom
el 20 de Sept. de 2019
Editada: shdotcom shdotcom
el 20 de Sept. de 2019
0 comentarios
Ver también
Categorías
Más información sobre MATLAB Support for MinGW-w64 C/C++ Compiler en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!