简体   繁体   English

在C ++代码中集成Matlab C ++共享库

[英]Integrating matlab C++ shared library in C++ code

I am trying to call a simple MyAdd function compiled by matlab compiler into C++, but I fail to initialize matlab runtime. 我试图将由matlab编译器编译成C ++的简单MyAdd函数调用,但是无法初始化matlab运行时。 Here is my code 这是我的代码

#include "MyAdd.h"
void main(){
    mclInitializeApplication(NULL,0);
}

I correctly set the linker and include directories. 我正确设置了链接器并包含目录。 In fact this code compiles without any problem, when I run my code, in debug or release I get the following error: 实际上,当我运行我的代码时,在调试或发布时,该代码可以毫无问题地编译,并且会出现以下错误:

    'MyPro.exe': Loaded 'C:\Users\Mina\Documents\Visual Studio 2008\Projects\CCSharedLibTest\Debug\MyPro.exe', Symbols loaded.
    'MyPro.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
    'MyPro.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
    'MyPro.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
    The program '[13016] MyPro.exe: Native' has exited with code -1073741701 (0xc000007b).

I guess I have issue with 32bit/64bit. 我猜我对32位/ 64位有问题。 Any suggestion to solve this problem? 有解决这个问题的建议吗? Thank you 谢谢

从main返回之前,必须调用mclTerminateApplication。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM