- https://www.mathworks.com/help/matlab/ref/mex.html
- https://www.mathworks.com/help/matlab/ref/pwd.html
Iam facing Below Issues While Compelling the model in Matlab 2021rb
5 views (last 30 days)
Show older comments
Caused by: "C:\Program Files\MATLAB\R2021b\bin\win64\mex.exe" -R2018a -c -DMATLAB_MEX_FILE -I"D:\Users\Sumanth\OCTOBER\ -I"C:\Program Files\MATLAB\R2021b\extern\include" -I"C:\Program Files\MATLAB\R2021b\simulink\include" -I"C:\Program Files\MATLAB\R2021b\rtw\c\src" -I"D:\Users\Sumanth\OCTOBER\ CFLAGS="$CFLAGS -w " APItest_cgxe.c D:\Users\Sumanth\OCTOBER\#br_498475_ASW_TAG_9_00\src\Model_dev\moncdd\Mdl\slprj\_cgxe\APItest\src\Files\MATLAB\R2021b\extern\include -IC:\Program not detected; check that you are in the correct current folder, and check the spelling of 'D:\Users\Sumanth\OCTOBER\#br_498475_ASW_TAG_9_00\src\Model_dev\moncdd\Mdl\slprj\_cgxe\APItest\src\Files\MATLAB\R2021b\extern\include -IC:\Program'. gmake: *** [APItest_cgxe.obj] Error -1
0 Comments
Answers (2)
Sahas
on 22 Oct 2024
Hi,
As per my understanding, you are trying to generate a simulation target MEX file for a Simulink model "APItest". From the error text provided, it looks like Simulink is not able to read the path of the files due to white spaces or special characters in file name and file path.
I recommend wrapping all the file paths that contain folders and file names with white spaces and special characters in single quotes or renaming such folders and file names so that they don't contain any white spaces or special characters.
Alternatively, you can use MATLAB's "pwd" function to get the present working directory and -I argument to include the file. Refer to the following MathWorks documentation links for steps to specifying the path to include the file and using the "pwd" function:
Also, check out the MATLAB Answer below which resolves the issue of adding libraries in file paths while running the MEX command:
I hope this is beneficial!
0 Comments
Bruno Luong
on 22 Oct 2024
-I"D:\Users\Sumanth\OCTOBER\ CFLAGS="$CFLAGS -w "
It seems the second double quotes are wrongly placed
0 Comments
See Also
Categories
Find more on Simulink Environment Customization 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!