Mex file won't compile without -g option
Show older comments
I want to compile a large c file (7000 lines) with the matlab command 'mex'. When I use the following command, the file does compile.
mex -g file.c
However, when I leave out the debug option '-g', the file won't compile and I got a lot of warning messages, but no error message. Even when I solve all warning messages, the file won't compile without the debug option. I do want to leave out this option, as this results in a faster execution of the c file. If I put part of the file in comment, the file compiles again. So I assume this has something to do with the length of the c file? Does anyone know how to solve this problem?
Regards
Answers (1)
James Tursa
on 4 May 2016
0 votes
7000 lines of code is not large at all. It is highly unlikely that your problems are related to the size of your source code. What specific warnings/errors are you getting? What is in the section of code that you comment out to get things working?
1 Comment
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!