Per the MATLAB coder documentation here:
I would like to define a namespace.
The documentation provides the following code as an example:
cfg = coder.config('dll');
cfg.TargetLang = 'C++';
cfg.CppNamespace = 'generated';
codegen -config cfg foo
My code is the following:
txcfg = coder.config('dll');
txcfg.TargetLang = 'C++';
txcfg.EnableOpenMP = false;
txcfg.CppNamespace = 'Transmitter';
txcfg.PreserveVariableNames = 'UserNames';
txcfg.GenCodeOnly = true;
txcfg.Toolchain = 'Microsoft Visual C++ 2017 v15.0 | nmake (64-bit Windows)';
Yet, the above coder config produces the following error:
Unrecognized property 'CppNamespace' for class 'coder.CodeConfig'.
Error in OFDMSynchronizationExample (line 25)
txcfg.CppNamespace = 'Transmitter';
Why isn't this working?

 Respuesta aceptada

Steven Lord
Steven Lord el 2 de Oct. de 2019

0 votos

According to the Release Notes I believe that functionality was introduced in release R2019b. You're using release R2019a.

2 comentarios

Chance Jones
Chance Jones el 2 de Oct. de 2019
I was about to delete this question because an update to 2019b solved the issue. But I'll leave it up incase someone else encounters this.
Steven Lord
Steven Lord el 3 de Oct. de 2019
Yes, please do leave this question in place. One of the benefits of MATLAB Answers is to serve as a knowledge base, where hopefully people can find the information they're seeking without them needing to ask as it's already been asked and answered.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2019a

Preguntada:

el 2 de Oct. de 2019

Comentada:

el 3 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by