我有一个Simulink模型,试图将其生成为C++ dll。我已经成功地编译了类似的模型,但是这给了我以下错误:
CGIR assertion 'fitsType<size_t>()' failed in 'b:\matlab\derived\win32\src\include\cg_ir\util_prim\../../../../../../src/cg_ir/export/include/cg_ir/util_prim/Size64.hpp:125'
[ 0] 0x5d20bde3 C:\MATLABR2011b_x86\bin\win32\cg_ir.dll+00769507 ( CG::Scope::treeStackSize+000019 )
[ 1] 0x5d200b68 C:\MATLABR2011b_x86\bin\win32\cg_ir.dll+00723816 ( CG::Fcn::stackSize+000024 )
[ 2] 0x590d36e2 C:\MATLABR2011b_x86\bin\win32\cgir_xform.dll+02242274 ( CG::EnforceStackLimit::getFcnStackSize+000034 )
[ 3] 0x590d390a C:\MATLABR2011b_x86\bin\win32\cgir_xform.dll+02242826 ( CG::EnforceStackLimit::initialize_fcn_stack_size_info+000234 )
[ 4] 0x590d42bb C:\MATLABR2011b_x86\bin\win32\cgir_xform.dll+02245307 ( CG::EnforceStackLimit::EnforceStackLimit+000219 )
[ 5] 0x59384cc2 C:\MATLABR2011b_x86\bin\win32\rtwcg.dll+00806082 ( RTWCG::getBlockParameterURLString+004434 )
[ 6] 0x59385e3b C:\MATLABR2011b_x86\bin\win32\rtwcg.dll+00810555 ( RTWCG::getBlockParameterURLString+008907 )
[ 7] 0x593706f1 C:\MATLABR2011b_x86\bin\win32\rtwcg.dll+00722673 ( RTWCG::RTWFcnConst::OptimizeAndEmitCode+007777 )
[ 8] 0x5933085d C:\MATLABR2011b_x86\bin\win32\rtwcg.dll+00460893 ( RTWCG::RTWCGModule::OptimizeAndEmitCode+000125 )
[ 9] 0x5a6f9ecd C:\MATLABR2011b_x86\bin\win32\libmwsimulink.dll+08298189 ( BlockSetCheckVarDimsInputEmpty+066381 )
[ 10] 0x5a6f6f97 C:\MATLABR2011b_x86\bin\win32\libmwsimulink.dll+08286103 ( BlockSetCheckVarDimsInputEmpty+054295 )
[ 11] 0x5a74aa02 C:\MATLABR2011b_x86\bin\win32\libmwsimulink.dll+08628738 ( sleGetRTWBlockForSLBlock+262210 )
[ 12] 0x5a74af9f C:\MATLABR2011b_x86\bin\win32\libmwsimulink.dll+08630175 ( sleGetRTWBlockForSLBlock+263647 )
[ 13] 0x5a23b9c5 C:\MATLABR2011b_x86\bin\win32\libmwsimulink.dll+03324357 ( ArrayToSLObject+481685 )
[ 14] 0x025dea8c C:\MATLABR2011b_x86\bin\win32\m_dispatcher.dll+00060044 ( mdLogging::log_function_exit+000108 )
[ 15] 0x025de561 C:\MATLABR2011b_x86\bin\win32\m_dispatcher.dll+00058721 ( Mfunction_handle::dispatch+000401 )
### Build procedure for model: 'vcts_auxiSns' aborted due to an error.
我还在对话框中收到以下错误消息:
Unexpected or internal error encountered in "in CGIR: b:\matlab\derived\win32\src\include\cg_ir\util_prim\../../../../../../src/cg_ir/export/include/cg_ir/util_prim/Size64.hpp line 125: fitsType<size_t>()
". Please report this to MathWorks if you can cause it to recur
更新:
我现在已经能够找到问题所在,而且似乎是特定信号存在问题。下图显示了子系统的一小部分,只要允许红色框中的三个信号之一流通,就无法通过代码生成模型。一旦我破坏了所有三个信号,代码生成就会起作用。
不幸的是,我无法解决问题,因此我仍然渴望听到任何建议!
最佳答案
事实证明,这是Matlab 2011b中代码生成中信号传播的错误。根据Mathworks的说法,该问题在2012a和更高版本中得到了解决,因此我将其更新为2013b。现在,我不再遇到该错误。
关于c++ - CGIR断言 'fitsType<size_t>()'失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23220299/