Help Please! matlab and c++ ,problem :forrtl: error (200): program aborting due to windows-CLOSE event
4 次查看(过去 30 天)
显示 更早的评论
Dear sir or madam,
I am using matlab R2012a to write future trade strategy, later complied the m file into .h,.Dll,*.lib; finally link this library at a c++ win32 console program.
I am comfirm that the c++ code and matlab strategy is free of error while they run indipendently.
The whole trade program run well except that whenever I click the Close button at the top right corner of the console form:
unexpected breakpoint was trigger and the program can't terminate normally.
Here's the details illustrations: ----------------------------------------------------------------------------------------------------------
1) main function code segment:
int _tmain(int argc, _TCHAR* argv[]) {
//<<<--------------------Begin Initialization------------------>>>>
......
if(!libsen_tradeInitialize())
{
std::cout <<"------------------》》》》Could not initialize StrategyLib《《《《-----------------------!" << std::endl;
getchar();
return -1;
}
//<<<--------------------Release Resource .......
// terminate MCR
libsen_tradeTerminate();
mclTerminateApplication();
return 0;
}
--------------------------------------------------------------------------------------------------------
after serveral day's testing, finally, I find that whenever I comment out the code block:
/*
if(!libsen_tradeInitialize())
{
std::cout <<"------------------》》》》Could not initialize StrategyLib《《《《-----------------------!" << std::endl;
getchar();
return -1;
}
*/
the program can exist normally.
I have found a post on :http://www.mathworks.com/matlabcentral/newsreader/view_thread/251203
but very sorry that can't exactly understand the solution:
do somebody ever encounter this problem? Please give me some suggestion !
Thank you very much!
Zhishang.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call C++ from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!