Problem with legacy_code compilation and preprocessor directives
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!