Problem with legacy_code compilation and preprocessor directives

3 visualizzazioni (ultimi 30 giorni)
Hello, Sorry if this has already been addressed, but I've been searching for quite a while and did not find the answer. I have a problem with legacy_code compiler options. I want to set a preprocessor definition e.g. "VALUE" equal to a name of a header file e.g. "header.h". VALUE is used in preprocessor directives in a cpp file:
#ifdef VALUE
#include VALUE
The following syntax works on a Mac with MATLAB r2013a and a gcc compiler:
legacy_code('compile', my_sfun, '-DVALUE=\\\"header.h\\\"');
However, on win7 x64 with MATLAB r2012b and an SDK 7.1 compiler the following error is printed:
fatal error C1083: Cannot open include file: '': No such file or directory
Here is a list of modifications I tried and what error they produced:
'-DVALUE=\"header.h\"'
fatal error C1083: Cannot open include file: '': No such file or directory
'-DVALUE="header.h"'
fatal error C1083: Cannot open include file: '': No such file or directory
'-DVALUE=\<header.h\>'
The filename, directory name, or volume label syntax is incorrect.
'-DVALUE=<header.h>'
The filename, directory name, or volume label syntax is incorrect.
'-DVALUE=header.h'
fatal error C1083: Cannot open include file: '': No such file or directory
Anybody that can help me with this, please?

Risposte (0)

Categorie

Scopri di più su Troubleshooting in MATLAB Compiler SDK in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by