Clear Filters
Clear Filters

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

10 views (last 30 days)
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?

Answers (1)

Pedro Carranza Velez
Pedro Carranza Velez on 13 May 2023
I managed to solve the issue. Turns out Mingw is not supported for audio plugin generation
  2 Comments
Pedro Carranza Velez
Pedro Carranza Velez on 29 Oct 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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!