mex compiled error with garbled code

Hi, I am writing a c-mex function. At present, I have completed the writing of the. C file, but after compiling with the MEX instruction, I reported an error and garbled code. Could you please provide me with some ideas to solve the problem?

Antworten (1)

Samay Sagar
Samay Sagar am 20 Sep. 2024

0 Stimmen

The errors you are encountering suggest that there might be syntax errors in your C source file. Here are some steps you can take to resolve these issues:
  1. The errors like "C2143" and "C2449" suggest there might be missing semicolons (;), parentheses, or braces.
  2. Ensure that your code is compatible with the version of the compiler you are using.
  3. Use the "-v" option with the "mex" command for more detailed output, which can provide additional information regarding the errors.
  4. Ensure all preprocessor directives (#include, #define, #if, #endif, etc.) are correctly used and terminated. The error "C1070" suggests a possible issue with these.
  5. If the issue persists, try using a different compiler to see if the problem is specific to Microsoft Visual C++.
For more information about "mex" you can refer the following documentation:

Kategorien

Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2022a

Gefragt:

am 3 Nov. 2022

Beantwortet:

am 20 Sep. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by