Why do I get an "Options file is invalid" error when I try to build an S-Function in MATLAB R2016b?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 24 de Sept. de 2020
Editada: MathWorks Support Team
el 29 de Mzo. de 2024 a las 10:26
I am trying to use the S-function target to generate an S-function from my subsystem. However, I encounter the following build error:
### Compiling foo_sf.c
C:\PROGRA~1\MATLAB\R2016b\bin\mex -c -v -win64 OPTIMFLAGS="/Od /Oy-" -f
"C:\Users\johndoe\AppData\Roaming\MathWorks\MATLAB\R2016b\mex_C_win64.xml" foo_sf.c
Error: An options file for MEX was found, but the value for 'COMPILER'
was not set. This could mean that the value is not specified
within the options file, or it could mean that there is a
syntax error within the file.
C:\PROGRA~1\MATLAB\R2016b\BIN\MEX.PL: Error: Options file is invalid.
Respuesta aceptada
MathWorks Support Team
el 29 de Mzo. de 2024 a las 0:00
Editada: MathWorks Support Team
el 29 de Mzo. de 2024 a las 10:26
The above error message indicates that the build process invoked "mex.pl" (Perl script from an obsolete workflow), instead of "mex.bat". This can happen of the PATHEXT environment variable has the .PL extension listed before the .BAT extension. In this case, the output from the "getenv('PATHEXT')" command may look as given below:
>> getenv('PATHEXT')
ans =
PL;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
In order for the build process to succeed, please overwrite the PATHEXT environment variable for your MATLAB session so that the .PL extension is not included (or placed somewhere behind .BAT), by using the following command:
>> setenv('PATHEXT','COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC');
In order to automate the execution of the above command at the start of every MATLAB session, add it to a "startup.m" file as shown in the following documentation page:
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Simulink Coder 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!