generateAudioPlugin error - MEX configured to use visual studio c++ 2019, but LCC is the default compiler

5 visualizaciones (últimos 30 días)
OS: Windows 10 Home
As the thread title indicates, when I attempt to generate an audio plugin (after running mex -setup to configure MEX to use visual studio c++ 2019 and validateAudioPlugin) this appears on the console:
>> mex -setup
MEX configured to use 'Microsoft Visual C++ 2019 (C)' for C language compilation.
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
MEX configured to use 'Microsoft Visual C++ 2019' for C++ language compilation.
>> validateAudioPlugin('TremoloProj6')
Checking plugin class 'TremoloProj6'... passed.
Generating testbench file 'testbench_TremoloProj6.m'... done.
Running testbench... passed.
Generating mex file 'testbench_TremoloProj6_mex.mexw64'... done.
Running mex testbench... passed.
Deleting testbench.
Ready to generate audio plugin.
>> generateAudioPlugin('TremoloProj6')
..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
I've been searching for information on how to change the target language, but I have not been able to find anything that works when I use it.
Here's the code for the audio plugin I'm trying to generate:
classdef TremoloProj6 < audioPlugin
methods
function out = process(~,in)
out = in;
end
end
end

Respuesta aceptada

Pedro Dores
Pedro Dores el 7 de Abr. de 2021
I figured it out, I needed to use these two lines of code to set the target language to c++:
cfg = coder.config('lib');
cfg.TargetLang = 'C++';
This thread can be closed.
  2 comentarios
Pedro Dores
Pedro Dores el 4 de Mayo de 2021
Editada: Pedro Dores el 4 de Mayo de 2021
If I recall correctly, using that command made Matlab use Microsoft Visual C++ 2019 for C++ compilation, but Matlab still had the target language for compilation set to C, so it defaulted to the LCC compiler.

Iniciar sesión para comentar.

Más respuestas (1)

Pedro Carranza Velez
Pedro Carranza Velez el 13 de Mayo de 2023
I am having the same issue that you had, but your solution is not working. What else can you remember doing?
  2 comentarios
Pedro Dores
Pedro Dores el 13 de Mayo de 2023
Unfortunately, I do not recall doing anything else, as I have not touched this project in years.

Iniciar sesión para comentar.

Categorías

Más información sobre Audio Plugin Creation and Hosting en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by