Matlab2015b使用MinGW64(TDM-GCC)编译mex.docx_第1页
Matlab2015b使用MinGW64(TDM-GCC)编译mex.docx_第2页
Matlab2015b使用MinGW64(TDM-GCC)编译mex.docx_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Install MinGW-w64 CompilerYou can use the MinGW-w64 version 4.9.2 compiler from TDM-GCC to build MEX files and standalone MATLABengine and MAT-file applications.Installing Compiler from Add-Ons MenuTo install the MinGW compiler, open the installer from MATLABAdd-Onsmenu. On theHometab, in theEnvironmentsection, click theAdd-Onsicon. UnderRefine by Type, selectFeatures, 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 SpaceDo not install MinGW in a location with spaces in the path name. For example, do not use:C:Program FilesTDM-GCC-64Instead, use:C:TDM-GCC-64Troubleshooting and Limitations Compiling C/C+ MEX Files with MinGW-w64Do Not Link to Library Files Compiled with Non-MinGW CompilersIf you use the MinGW compiler to build a MEX file that links to a library compiled with a non-MinGW compiler, such asMicrosoftVisual 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 thedlltoolutility from MinGW.MinGW Compiler Not Setup for Use with MEXIf 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 theCheck for updated files on the TDM-GCC servercheck box. This check box appears duringTDM-GCC Setupwhen you are asked toChoose which action you want the setup wizard to perform. For information about installing MinGW, seeInstalling Compiler from Add-Ons Menu.MinGW Installation Folder Cannot Contain SpaceDo not install MinGW in a location with spaces in the path name. For example, do not use:C:Program FilesTDM-GCC-64Instead, use:C:TDM-GCC-64MEX Command Does not Choose MinGWIf you only have the MinGW compiler installed on your system, themexcommand automatically chooses MinGW for both C and C+ MEX files. If you have multiple C or C+ compilers, usemex -setupto choose MinGW for both C and, if required, C+ MEX files.mex -setupmex -setup cppIf you only typemex -setupchoosing MinGW, when you compile a C+ file,mexmight choose a different compiler.Manually Configure MinGW for MATLABMATLAB detects the MinGW compiler by reading an environment variable,MW_MINGW64_LOC. When you install MinGW from the MATLABAdd-Onsmenu, MATLAB sets this variable.If necessary, you can set this variable globally, if you have Windowsadministrative 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 PanelTo set the environment variable on Windows 7:1. Make sure you have administrative privileges.2. SelectComputerfrom the Start menu.3. ChooseSystem propertiesfrom the context menu.4. ClickAdvanced system settingsAdvancedtab.5. ClickEnvironment Variables.6. UnderSystem variables, selectNew.7. In theNew System Variabledialog box, typeMW_MINGW64_LOCin theVariable namefield.8. In theVariable valuefield, type the location of the MinGW-w64 compiler installation, for example,C:TDM-GCC-64.9. ClickOkto close the dialog boxes, then close theControl Paneldialog box.Set variable for MATLAB sessionTo set the environ

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论