我有一些工作的Matlab代码,我尝试使用Matlab编码器转换成C代码。我得到这个错误:Matlab代码到C使用Matlab编码器
18 c:\users\bla\project\strcmpi.h(79) : warning C4028: formal parameter 2 different from declaration
19 c:\users\bla\project\strcmpi.h(79) : error C2371: 'strcmpi' : redefinition; different basic types
20 c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(245) : see declaration of 'strcmpi'
21 NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
22 Stop.
23 The make command returned an error of 2
24 'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
25 operable program or batch file.
它看起来非常特定于我(我不是一个熟练的C程序员)。任何人都可以请指出我在正确的方向来克服这个错误?谢谢。
PS:
下面是一些适于Matlab代码:
if(strcmpi(parameters.x,'bladibla') == 1)
% some code
else
% some more code
end
其中 '参数' 是一个结构。我想坚持我的结构,但如果有更好的方法来实现上述,特别是在Matlab编码器和C的情况下,请让我知道。
您是否在Matlab代码中使用'strcmpi'函数和coder.ceval?包括代码的相关部分将有所帮助。 – sundar
感谢您的评论。我已经添加了一些Matlab代码(请参阅PS :)。 – cs0815