Qt与MATLAB混合编程
前言:本文主要讲述以Qt来开发,MATLAB做数学计算,c++来编写程序,将计算的结果生成相应的库文件或者直接生成一个可执行文件给Qt调用,以此来实现Qt与MATLAB混合编程。
环境概述:
操作系统:Win10 64位
Qt版本:Qt5.12.0
Matlab版本:Matlab2016a
1.设置MATLAB的编译器
mbuild -setup // 1打开MATLAB,输入此命令
Welcome to mbuild -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2012b/win32.html
Please choose your compiler for building shared libraries or COM components:
Would you like mbuild to locate installed compilers [y]/n? y // 2输入y,允许mbuild定位编译器
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\DEVELO~1\MATLAB\R2012b\sys\lcc
[2] Microsoft Visual C++ 2010 in D:\DevelopProgramFiles\VS2010
[0] None
Compiler: 1 // 3选择编译器,输入1即选用了[1] Lcc编译器,如果安装了VS2010可以选择2
Please verify your choices:
Compiler: Lcc-win32 C 2.4.1
Location: D:\DEVELO~1\MATLAB\R2012b\sys\lcc
Are these correct [y]/n? y // 4确认路径正确,输入y
Warning: Support for LCC with MATLAB