matlab 2012a mex设置,【mex成功但compile failed】:win7 64bit matlab R2012a mex问题

本帖最后由 Ericwjc 于 2014-6-17 19:35 编辑

运行 mex -setup时,出现:

Welcome to mex -setup.  This utility will help you set up

a default compiler.  For a list of supported compilers, see

http://www.mathworks.com/support/compilers/R2012a/win64.html

Please choose your compiler for building MEX-files:

Would you like mex to locate installed compilers [y]/n? y

No supported SDK or compiler was found on this computer.

For a list of supported compilers, see

http://www.mathworks.com/support/compilers/R2012a/win64.html

Error using mex (line 206)

Unable to complete successfully.

如果 Would you like mex to locate installed compilers [y]/n?n

Select a compiler:

[1] Intel C++ 12.0 (with Microsoft Software Development Kit (SDK) linker)

[2] Intel C++ 12.0 (with Microsoft Visual C++ 2008 SP1 linker)

[3] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker)

[4] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker)

[5] Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker)

[6] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 SP1 linker)

[7] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 Shell linker)

[8] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2010 linker)

[9] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker)

[10] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker)

[11] Microsoft Software Development Kit (SDK) 7.1

[12] Microsoft Visual C++ 2005 SP1

[13] Microsoft Visual C++ 2008 SP1

[14] Microsoft Visual C++ 2010

[0] None

Compiler:

compiler 选 11或者13或者14都不行。

Warning: The default location for Microsoft Visual C++ 2010 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 Visual C++ 2010

Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0

Are these correct [y]/n? y

*****************************************************************************

Error: Microsoft Visual C++ 2010 requires the Microsoft Windows Software

Development Kit (SDK), but the SDK cannot be found.  Examine your

Microsoft Visual C++ 2010 installation.

*****************************************************************************

Error using mex (line 206)

Unable to complete successfully.

请教高手,谢谢!

mex问题解决了!!!!!

之前按照网上说的安装各种 "Win SDK for Windows 7 and .NET 4",由于下载了 “GRMSDK_EN_DVD.iso”这个文件,安装的时候总是会显示 “Setup could not find the file WinSDK_amd64\WinSDK_amd64.msi at any of the specified source locations”。

然后还是在网上各种搜索,后来在看到了下面的说明:

================================================

File Name: GRMSDK_EN_DVD.iso

Chip: X86

CRC#: 0xCA4FE79D

SHA1: 0x8695F5E6810D84153181695DA78850988A923F4E

================================================

File Name: GRMSDKX_EN_DVD.iso

Chip: AMD64

CRC#: 0xB417A4F7

SHA1: 0x3393C98B8468CB3505557854922707510F8B65E1

================================================

File Name: GRMSDKIAI_EN_DVD.iso

Chip: Itanium

CRC#: 0x5E0E4BEA

SHA1: 0xAE454215585A044EBE593E9F71FF1A4BC03D56A8

================================================

看到了上面的”Chip: AMD64“,于是想这个会不会和“Setup could not find the file WinSDK_amd64\WinSDK_amd64.msi at any of the specified source locations”中的“amd64”有关,于是就下载了“GRMSDKX_EN_DVD.iso”,接着安装顺。

>> mex -setup

Welcome to mex -setup.  This utility will help you set up

a default compiler.  For a list of supported compilers, see

http://www.mathworks.com/support/compilers/R2012a/win64.html

Please choose your compiler for building MEX-files:

Would you like mex to locate installed compilers [y]/n? n

Select a compiler:

[1] Intel C++ 12.0 (with Microsoft Software Development Kit (SDK) linker)

[2] Intel C++ 12.0 (with Microsoft Visual C++ 2008 SP1 linker)

[3] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker)

[4] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker)

[5] Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker)

[6] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 SP1 linker)

[7] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 Shell linker)

[8] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2010 linker)

[9] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker)

[10] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker)

[11] Microsoft Software Development Kit (SDK) 7.1

[12] Microsoft Visual C++ 2005 SP1

[13] Microsoft Visual C++ 2008 SP1

[14] Microsoft Visual C++ 2010

[0] None

Compiler: 13

Warning: The default location for Microsoft Visual C++ 2008 SP1 compiler is:

"C:\Program Files (x86)\Microsoft Visual Studio 9.0"

but either that directory does not exist or the configuration

is invalid.

Use C:\Program Files (x86)\Microsoft Visual Studio 9.0 anyway [y]/n? y

Please verify your choices:

Compiler: Microsoft Visual C++ 2008 SP1

Location: C:\Program Files (x86)\Microsoft Visual Studio 9.0

Are these correct [y]/n? y

***************************************************************************

Warning: MEX-files generated using Microsoft Visual C++ 2008 require

that Microsoft Visual Studio 2008 run-time libraries be

available on the computer they are run on.

If you plan to redistribute your MEX-files to other MATLAB

users, be sure that they have the run-time libraries.

***************************************************************************

Trying to update options file: C:\Users\Administrator\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat

From template:              C:\PROGRA~1\MATLAB\R2012a\bin\win64\mexopts\msvc90opts.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:

Building with the -largeArrayDims option enables the new API.

**************************************************************************

但还是 compile failed !!!!???????????????????????????

C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: Compile of 'cemdc.c' failed.

请教高手上述问题,非常感谢!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Matlab中调用MEX文件的方法是通过使用MEX函数。MEX文件是由原C代码加上MEX文件专用的接口函数后编译而成的。MEX函数实现了一种接口,它将在Matlab中调用函数时输入的自变量通过特定的接口调入了C函数,得出的结果再通过该接口调回Matlab。具体的调用步骤如下: 1. 编写C代码并添加MEX文件专用的接口函数。 2. 在Matlab命令窗口中使用mex命令编译C代码,生成MEX文件。例如,使用命令"mex Matlab_1.cpp"编译名为Matlab_1.cpp的C代码。 3. 编译成功后,会在当前文件夹中生成一个MEX文件,通常以.dll或.mexw64为后缀。 4. 在Matlab中调用MEX文件时,使用MEX函数,并将输入参数传递给MEX函数。MEX函数会将结果存储在输出参数中。 5. 可以通过对输出参数进行赋值来获取MEX函数的结果。 需要注意的是,MEX函数的参数是用来说明Matlab调用MEX文件时的具体信息的,如输入参数和输出参数的个数和类型等。具体的参数设置可以根据实际情况进行调整。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *2* *3* [如何让matlabmex与C连接使用](https://blog.csdn.net/u010699502/article/details/53053534)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值