Problem with legacy_code compilation and preprocessor directives

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?

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息

提问:

2014-4-23

Community Treasure Hunt

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

Start Hunting!

Translated by