Matlab2015b使用MinGW64(TDM-GCC)编译mex
更新时间:2024-04-13 10:41:01 阅读量: 综合文库 文档下载
Install MinGW-w64 Compiler You can use the MinGW-w64 version 4.9.2 compiler from TDM-GCC to build MEX files and standalone MATLAB engine and MAT-file applications.
?
Installing Compiler from Add-Ons Menu
To install the MinGW compiler, open the installer from MATLAB Add-Ons menu. On the Home tab, in the Environment section, click the Add-Ons icon. Under Refine by Type, select Features, or search for MinGW. Follow the prompts to add the compiler.
Note: To install the MATLAB-supported version of MinGW-w64, you must clear the check box highlighted in the following figure.
MinGW Installation Folder Cannot Contain Space
Do not install MinGW in a location with spaces in the path name. For example, do not use:
C:\\Program Files\\TDM-GCC-64
Instead, use:
C:\\TDM-GCC-64
Troubleshooting and Limitations Compiling C/C++ MEX Files with MinGW-w64
Do Not Link to Library Files Compiled with Non-MinGW Compilers
If you use the MinGW compiler to build a MEX file that links to a library compiled with a non-MinGW compiler, such as Microsoft Visual Studio, the file will not run in MATLAB. Library (.lib) files
?
?
?
generated by different compilers are not compatible with each other. You can generate a new library file using the dlltool utility from MinGW.
MinGW Compiler Not Setup for Use with MEX
If you installed the MinGW compiler but MATLAB does not recognize it, the compiler might not be the supported version.
To install the MATLAB-supported version of MinGW-w64, you must clear the Check for updated files on the TDM-GCC server check box. This check box appears during TDM-GCC Setup when you are asked to Choose which action you want the setup wizard to perform. For information about installing MinGW, see Installing Compiler from Add-Ons Menu.
MinGW Installation Folder Cannot Contain Space
Do not install MinGW in a location with spaces in the path name. For example, do not use:
C:\\Program Files\\TDM-GCC-64
Instead, use:
C:\\TDM-GCC-64
MEX Command Does not Choose MinGW
If you only have the MinGW compiler installed on your system, the mex command automatically chooses MinGW for both C and C++ MEX files. If you have multiple C or C++ compilers, use mex
-setup to choose MinGW for both C and, if required, C++ MEX files.
mex-setup mex-setupcpp
If you only type mex -setup choosing MinGW, when you compile a C++ file, mex might choose a
different compiler.
Manually Configure MinGW for MATLAB
MATLAB detects the MinGW compiler by reading an environment variable, MW_MINGW64_LOC. When you install MinGW from the MATLAB Add-Ons menu, MATLAB sets this variable.
If necessary, you can set this variable globally, if you have Windows administrative privileges, using the
?
Windows Control Panel. Alternatively, set the variable every time you open MATLAB.
Note: Verify you have installed MinGW-w64 version 4.9.2 before setting the environment variable.
Set variable using Windows Control Panel To set the environment variable on Windows 7: 1. Make sure you have administrative privileges. 2. Select Computer from the Start menu.
3. Choose System properties from the context menu. 4. Click Advanced system settings > Advanced tab. 5. Click Environment Variables. 6. Under System variables, select New.
7. In the New System Variable dialog box, type MW_MINGW64_LOC in the Variable
name field.
8. In the Variable value field, type the location of the MinGW-w64 compiler installation, for
example, C:\\TDM-GCC-64.
9. Click Ok to close the dialog boxes, then close the Control Panel dialog box. Set variable for MATLAB session
To set the environment variable in MATLAB, type:
setenv('MW_MINGW64_LOC',folder)
where folder is the installation directory, for example, 'C:\\TDM-GCC-64'. You must set the
variable every time you run MATLAB.
正在阅读:
Matlab2015b使用MinGW64(TDM-GCC)编译mex04-13
山东省济南市育英中学2016秋七年级语文能力竞赛试卷04-05
部编九年级道德与法治第三课第2课时参与民主生活同步训练04-15
夏镇一中西校课内比较学活动总结07-05
小学语法经典总结 - 第三人称单数教案12-17
张融字思光原文及译文赏析08-26
农村个人建房申请书03-31
二年级下册暑假作业青岛版05-02
X射线复习和思考题05-07
- 人教新课标必修4 Unit2 Working the land名师导航
- 毕业生“校漂族”大行其道 - 0
- 江苏各市中考作文题出炉 - 0
- 暑期精品班 - 三角形 - 图文
- 情人节送什么礼物好??超强礼物已抵达
- 工程项目管理制度1
- 第四次业务学习 2016
- 会计要素与会计科目
- 欠发达地区小企业会计准则运用问题研究
- 一级锅炉水G4题库
- BBD双进双出筒式磨煤机安装使用说明书 SM-1
- 初一数学有理数教案
- 渝北区房地产评估市场调研报告
- iWebMall 数据字典
- 2018年小学入学教育工作计划
- 计量专业实务与案例分析 - 模拟题三 - 2013年版
- 启示录讲义
- 路基灰土改良(方案)
- 人行反洗钱岗位准入培训测试题集
- 2015电大《学前儿童发展心理学》期末试题及答案
- Matlab2015b
- 编译
- MinGW64
- 使用
- TDM
- GCC
- mex