提供MATLAB2013以上版本,在Windows 64位运行下,解决MATLAB coder 不能够调用C 编译器的问题解决方案!

tzhjzychg 2015-07-24 11:54:15
问题回顾:首先在MATLAB下调用c编译器,mex -setup以及mbuil -setup都不行的情形下有两个解决方案:
1.采用一个牛人的帖子:http://www.cnblogs.com/zhchngzng/p/4131035.html(我没找到必须文件下载地址)
2.按照官网的指导:http://cn.mathworks.com/support/compilers/R2013a/index.html?sec=win64&s_cid=pi_scl_1_R2013a_win64&s_tid=gn_loc_drop#matlab
问题解决途径:按照方案2执行如下:
1.打开网址链接,下载 Microsoft Windows SDK7.1(或者在微软官网下载,matlab提示该编译器支持所有win7以上64位版本MATLAB coder)。
2.下载后文件为:winsdk_web.exe,以管理员身份运行,下一步.............(不做其他修改即可),等待安装完成(半小时左右,看配置与网速情况)。
3.将MATLAB2013a软件推出,重新打开。
4.输入:mex -setup——>n——>17——>y——>y,即可完成SDK7.1的C编译器关联,显示如下:


Trying to update options file: C:\Users\YCHG\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat
From template: D:\worksoft\matlab\bin\win64\mexopts\mssdk71opts.bat

Done . . .

**************************************************************************
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the new
API. You can find more information about this at:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
Building with the -largeArrayDims option enables the new API.
**************************************************************************
5.输入:mex -setup——>y——>选择7.1版C编译器即可。
...全文
1772 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_41118904 2017-12-18
  • 打赏
  • 举报
回复
为什么我下载安装了winsdk_web.exe 可是,再运行mex -setup还是不行,我的matlab版本是2014a >> mex -setup 警告: Windows SDK 7.1 appears to be installed, but its compiler was not found. Install .NET Framework 4.0, and then rerun the SDK installation to add the "Visual C++ Compilers" component. See http://www.mathworks.com/support/solutions/en/data/1-IB1G3Q/ for more information. 错误使用 mex 未找到支持的编译器或 SDK。有关选项,请访问 http://www.mathworks.com/support/compilers/R2014a/win64。
sunyuanjiayou 2017-07-25
  • 打赏
  • 举报
回复
mbuild -setup 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/R2013b/win64.html Please choose your compiler for building shared libraries or COM components: Would you like mbuild to locate installed compilers [y]/n? n Select a compiler: [1] Microsoft Software Development Kit (SDK) 7.1 [2] Microsoft Visual C++ 2008 SP1 [3] Microsoft Visual C++ 2010 [4] Microsoft Visual C++ 2012 [0] None Compiler: 1 Warning: The default location for Microsoft Software Development Kit (SDK) compiler is: "C:\Program Files (x86)\Microsoft Visual Studio 10.0" but either that directory does not exist or the configuration is invalid. Use C:\Program Files (x86)\Microsoft Visual Studio 10.0 anyway [y]/n? y Please verify your choices: Compiler: Microsoft Software Development Kit (SDK) 7.1 Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0 Are these correct [y]/n? y ***************************************************************************** Error: The Microsoft Windows Software Development Kit (SDK) installation is incomplete. Please be sure that the .NET Framework is installed correctly before attempting to reinstall the SDK. ***************************************************************************** [color=#FF6600]Error using mbuild (line 189) Unable to complete successfully.[/color]
赵4老师 2017-03-02
  • 打赏
  • 举报
回复
不要做A语言代码修改为B语言代码的无用功。 也不要做用A语言代码直接调用B语言代码库这样复杂、这样容易出错的傻事。 只需让A、B语言代码的输入输出重定向到文本文件,或修改A、B语言代码让其通过文本文件输入输出。 即可很方便地让A、B两种语言之间协调工作。 比如: A将请求数据写到文件a.txt,写完后改名为aa.txt B发现aa.txt存在时,读取其内容,调用相应功能,将结果写到文件b.txt,写完后删除aa.txt,改名为bb.txt A发现bb.txt存在时,读取其内容,读完后删除bb.txt 以上A可以替换为任何一种开发语言或开发环境,B可以替换为任何一种与A不同的开发语言或开发环境。 除非A或B不支持判断文件是否存在、文件读写和文件更名。 但是谁又能举出不支持判断文件是否存在、文件读写和文件更名的开发语言或开发环境呢? 可以将临时文件放在RamDisk上提高效率减少磨损磁盘。 数据的结构很复杂的话,文本文件的格式问题可参考json或xml 共享临时文本文件这种进程之间的通讯方法相比其它方法的优点有很多,下面仅列出我现在能想到的: ·进程之间松耦合 ·进程可在同一台机器上,也可跨机,跨操作系统,跨硬件平台,甚至跨国。 ·方便调试和监视,只需让第三方或人工查看该临时文本文件即可。 ·方便在线开关服务,只需删除或创建该临时文本文件即可。 ·方便实现分布式和负载均衡。 ·方便队列化提供服务,而且几乎不可能发生队列满的情况(除非硬盘空间满) ·…… “跨语言、跨机,跨操作系统,跨硬件平台,跨国,跨*.*的”苦海无边, 回头是“使用共享纯文本文件进行信息交流”的岸!
shx88 2017-03-02
  • 打赏
  • 举报
回复
第一种解决方案需要的文件可从以下地址获得,其他版本的matlab可以从类似网页获取,复制文件后可以支持VS2013 1.http://cn.mathworks.com/matlabcentral/fileexchange/44408-matlab-mex-support-for-visual-studio-2013--and-mbuild- 2.http://download.csdn.net/detail/calyx/9719605

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧