如何用Matlab编译.dll,再用VC调用

1、mbuild   -setup      2、deploytool  3、选择库类型(c or c++ or .net)  4、加入m文件 5、setting  6、build 产生 dll

 

vc调用的话 先初始化
         if( !mclInitializeApplication(NULL,0) )
    {
        MessageBox("Could not initialize the application./n");
            return FALSE;
    }
    if (!testInitialize()){
        MessageBox("Could not initialize the library./n");
        return FALSE;
    }
里面 test就是产生的test.dll文件

mclmcrrt.lib test.lib这两个文件要加到链接附加项里

调用 mlftest();

最后        testTerminate();
        mclTerminateApplication();

你可能感兴趣的:(c,.net,null,matlab,Build)