Problem with legacy_code compilation and preprocessor directives

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

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!