声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 4629|回复: 4

[混合编程] 有关mbuild的问题

[复制链接]
发表于 2006-8-23 15:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
请问在使用mbuild命令时出现如下问题,是怎么回事,如何解决:
Could not find the compiler "cl" on the DOS path.
  Use mbuild -setup to configure your environment properly.


  D:\MATLAB701\BIN\WIN32\MEX.PL: Error: Unable to locate compiler.

??? Error using ==> mbuild
Unable to complete successfully
我使用的是matlab7.0

[ 本帖最后由 cdwxg 于 2006-8-23 15:06 编辑 ]
回复
分享到:

使用道具 举报

发表于 2006-8-23 15:12 | 显示全部楼层
Subject:
Why can't MEX find my MSVC compiler when I try to compile an engine program?


Problem Description
Why can't MEX find my MSVC compiler when I try to compile an engine program?



+ mex -f d:\matlabr11\bin\msvc60engmatopts.bat d:\matlabr11\extern\examples\eng_mat\engdemo.c




Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.

D:\MATLABR11\BIN\MEX.BAT: Unable to locate compiler.



Solution:
This problem is caused by an ommision in the MSVC60ENGMATOPTS.BAT file located in $MATLAB\bin, where $MATLAB is the root MATLAB directory.

The line that sets the MSVCDir variable needs to use the DOS path to the MSVC 6.0 directory and include the VC98 directory. You should edit the MSVC60ENGMATOPTS.BAT file to reflect this change.

For example, on one computer, this section:




rem ********************************************************************
rem General parameters
rem ********************************************************************
set MATLAB=%MATLAB%
set MSVCDir=%MSVCDir%
set MSDevDir=%MSVCDir%\..\Common\msdev98
set PATH=%MSVCDir%\BIN;%MSDevDir%\bin;%PATH%



Should read like this:



rem ********************************************************************
rem General parameters
rem ********************************************************************
set MATLAB=%MATLAB%
set MSVCDir=D:\Applications\Micros~2\vc98
set MSDevDir=%MSVCDir%\..\Common\msdev98
set PATH=%MSVCDir%\BIN;%MSDevDir%\bin;%PATH%
发表于 2006-11-2 11:34 | 显示全部楼层

把msvc60engmatopts.bat改了以后仍然出错

1、mbuild -setup,选了msvc6.0编译器;
2、mcc -m filenames, 出错:
     Could not find the compiler "cl" on the DOS path.
  Use mbuild -setup to configure your environment properly.


  C:\PROGRAM FILES\MATLAB704\BIN\WIN32\\..\WIN32\MEX.PL: Error: Unable to locate compiler.

3、把msvc60engmatopts.bat中的
      rem************************
      rem General parameters
      rem************************
      set MATLAB=%MATLAB%
      set MSVCDir=%MSVCDir%
      set MSDevDir=%MSVCDir%\..\Common\msdev98
      set PATH=%MAVCDir%\BIN;%MSDevDir%\bin;%PATH%

      改为:

      rem************************
      rem General parameters
      rem************************
      set MATLAB=%MATLAB%
      set MSVCDir=C:Program files\Micro...\VC98
      set MSDevDir=%MSVCDir%\..\Common\msdev98
      set PATH=%MAVCDir%\BIN;%MSDevDir%\bin;%PATH%

      再mcc还是出错,出错提示跟上面一样,是什么原因阿?
发表于 2006-11-7 02:01 | 显示全部楼层
原帖由 arlay 于 2006-11-2 11:34 发表
1、mbuild -setup,选了msvc6.0编译器;
2、mcc -m filenames, 出错:
     Could not find the compiler "cl" on the DOS path.
  Use mbuild -setup to configure your environment properly.
  ...



在mathworks上找了一下,相关的结果已经在http://forum.vibunion.com/forum/thread-29598-1-1.html上给出来了
发表于 2006-11-9 15:56 | 显示全部楼层
thanks a lot! ^_^
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-19 20:37 , Processed in 0.056217 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表