Matlab change default compiler from LCC to C++ not working.

13 visualizaciones (últimos 30 días)
Pedro Carranza Velez
Pedro Carranza Velez el 13 de Mayo de 2023
Comentada: Pedro Carranza Velez el 29 de Oct. de 2023
I am working on developping an audio plugin on matlab. I manage to get it to validate, but I'm getting the following issue with generateAudioPlugin:
>> cfg = coder.config('lib');
>> cfg.TargetLang = 'C++';
>> mex -setup C++
MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.
>> validateAudioPlugin myVocoder
Checking plugin class 'myVocoder'... passed.
Generating testbench file 'testbench_myVocoder.m'... done.
Running testbench... passed.
Generating mex file 'testbench_myVocoder_mex.mexw64'... done.
Running mex testbench... passed.
Deleting testbench.
Ready to generate audio plugin.
>> generateAudioPlugin -vst3 myVocoder
..Warning: Selected C compiler is incompatible with C99 (ISO) language standard. Code generation will switch to C89/90 (ANSI) instead.
Consider changing C compiler or target language setting to suppress this warning.
??? The specified code generation target is configured to generate C++, but the C-only compiler, LCC, is the default compiler. To allow
code generation, you can deselect the 'Generate makefile' option. Or, to specify a C++ compiler, enter 'mex -setup' at the command
prompt. To generate C code, set the target language to C in the configuration object.
Code generation failed: View Error Report
Error using coder.internal.generateAudioPlugin
Error in generateAudioPlugin
Error in generateAudioPlugin
Error in generateAudioPlugin
As you can see, I do set mex and default targer language to C++. Why does it keep using LCC as the default compiler? How can I change it?

Respuestas (1)

Pedro Carranza Velez
Pedro Carranza Velez el 13 de Mayo de 2023
I managed to solve the issue. Turns out Mingw is not supported for audio plugin generation
  2 comentarios
Javier
Javier el 29 de Oct. de 2023
What did you do to solve it?
Pedro Carranza Velez
Pedro Carranza Velez el 29 de Oct. de 2023
I can't remember the specifics, but I downloaded a C/C++ compiler other than MinGW64, then using mex -setup I selected this new compiler and it worked.

Iniciar sesión para comentar.

Categorías

Más información sobre Call C++ from MATLAB 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!

Translated by