現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
Errors related to Simulink containing Embedded Matlab Function
4 ビュー (過去 30 日間)
古いコメントを表示
Nitin Reddy Ganna
2012 年 2 月 24 日
I am using Matlab R2011a version 7.12.My platform is windows 7 and 64 bit.When i try to run the simulink model containing embedded function,I get the following error.
"Making simulation target "New_sfun", ...
C:\Users\nitin\Documents\MATLAB\slprj\_sfprj\New\_self\sfun\src>call "mexopts.bat" 'nmake' is not recognized as an internal or external command, operable program or batch file. "
I installed
1.Microsoft Visual studio 2010 SERVICE PACK
2.Microsoft Visual Express c++ 2010 express
3.Microsoft Software Development kit 7.1
4 .NET Framework 4.0
Please kindly help me with this.I searched a lot in the internet,but couldn't solve my problem.
回答 (1 件)
Kaustubha Govind
2012 年 2 月 24 日
You need to run the "mex -setup" command and select your installed compiler.
16 件のコメント
Nitin Reddy Ganna
2012 年 2 月 24 日
I tried the same earlier and selected Microsoft Visual Studio C++ 2010 Express as my compiler, but still couldn't solve my problem.
Kaustubha Govind
2012 年 2 月 24 日
Did the message from "mex -setup" says that the options file was updated successfully? Could you try deleting the "slprj" directory in the folder and try again.
Nitin Reddy Ganna
2012 年 2 月 27 日
After running "mex -setup" command here is what comes:
"Please verify your choices:
Compiler: Microsoft Visual C++ 2010 Express
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
***************************************************************************
Warning: MEX-files generated using Microsoft Visual C++ 2010 require
that Microsoft Visual Studio 2010 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\nitin\AppData\Roaming\MathWorks\MATLAB\R2011a\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2011a\bin\win64\mexopts\msvc100freeopts.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/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
************************************************************************** "
I have tried deleting the "slprj" directory,but still no use.
The same error appears.
Kaustubha Govind
2012 年 2 月 27 日
Do you have C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\nmake.exe present on your machine?
Nitin Reddy Ganna
2012 年 2 月 28 日
Yeah..
I tried to run the same simulink model in 32-bit operating system.It was running fine.
The compiler there was "lcc win-32".
Kaustubha Govind
2012 年 2 月 28 日
Okay - try this in a Windows (system) command prompt:
> call "C:\Users\nitin\AppData\Roaming\MathWorks\MATLAB\R2011a\mexopts.bat"
> nmake /?
What do you see?
Nitin Reddy Ganna
2012 年 2 月 29 日
"'nmake' is not recognized as an internal or external command,operable program or batch file."
Kaustubha Govind
2012 年 2 月 29 日
Open up C:\Users\nitin\AppData\Roaming\MathWorks\MATLAB\R2011a\mexopts.bat in an editor and see if "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" is being added to the system PATH variable correctly. Note that you might need to chase down values of variables such as VCINSTALLDIR that are created earlier in the same batch script.
Nitin Reddy Ganna
2012 年 3 月 2 日
It's still not working.I re-installed matlab and this time when i run the mex -setup i get different error:
"
*****************************************************************************
Error: Could not find the 64-bit compiler. This may indicate that the
"X64 Compilers and Tools" or the Microsoft Windows Software
Development Kit (SDK) is not installed. To build 64-bit MEX-files
Microsoft Visual C++ 2010 requires that these two packages are
installed properly.
*****************************************************************************
??? Error using ==> mex at 208
Unable to complete successfully."
Kaustubha Govind
2012 年 3 月 2 日
See footnote#3 here: http://www.mathworks.com/support/compilers/R2011a/win64.html - by default Visual Studio only installs compilers for 32-bit targets. Since you are using 64-bit MATLAB, you need to make sure that you install the x64 Compilers and Tools package with Visual Studio.
Nitin Reddy Ganna
2012 年 3 月 2 日
Here is the mexopts.bat file.I cross checked it with the batch file created where the model could be simulated.Both of them were same.Please notify the changes to be made if any.
"" @echo off
rem MSVC100FREEOPTS.BAT
rem
rem Compile and link options used for building MEX-files
rem using the Microsoft Visual C++ Express compiler version 10.0
rem
rem $Revision: 1.1.12.2 $ $Date: 2010/09/02 12:40:43 $
rem Copyright 2010 The MathWorks, Inc.
rem
rem StorageVersion: 1.0
rem C++keyFileName: MSVC100FREEOPTS.BAT
rem C++keyName: Microsoft Visual C++ 2010 Express
rem C++keyManufacturer: Microsoft
rem C++keyVersion: 10.0
rem C++keyLanguage: C++
rem
rem ********************************************************************
rem General parameters
rem ********************************************************************
set MATLAB=%MATLAB%
set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0
set VCINSTALLDIR=%VSINSTALLDIR%\VC
rem In this case, LINKERDIR is being used to specify the location of the SDK
set LINKERDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1\
set PATH=%VSINSTALLDIR%\Common7\IDE;%VSINSTALLDIR%\Common7\Tools;%VCINSTALLDIR%\bin\amd64;%VCINSTALLDIR%\bin\VCPackages;%LINKERDIR%\Bin\NETFX 4.0 Tools\x64;%LINKERDIR%\Bin\x64;%LINKERDIR%\bin;%MATLAB_BIN%;%PATH%
set INCLUDE=%VCINSTALLDIR%\INCLUDE;%LINKERDIR%\include;%LINKERDIR%\include\gl;%INCLUDE%
set LIB=%VCINSTALLDIR%\LIB\amd64;%LINKERDIR%\lib\x64;%VCINSTALLDIR%\LIB;%MATLAB%\extern\lib\win64;%LIB%
set MW_TARGET_ARCH=win64
rem ********************************************************************
rem Compiler parameters
rem ********************************************************************
set COMPILER=cl
set COMPFLAGS=/c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD
set OPTIMFLAGS=/O2 /Oy- /DNDEBUG
set DEBUGFLAGS=/Z7
set NAME_OBJECT=/Fo
rem ********************************************************************
rem Linker parameters
rem ********************************************************************
set LIBLOC=%MATLAB%\extern\lib\win64\microsoft
set LINKER=link
set LINKFLAGS=/dll /export:%ENTRYPOINT% /LIBPATH:"%LIBLOC%" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"%LIB_NAME%.x" /MAP:"%OUTDIR%%MEX_NAME%%MEX_EXT%.map"
set LINKOPTIMFLAGS=
set LINKDEBUGFLAGS=/debug /PDB:"%OUTDIR%%MEX_NAME%%MEX_EXT%.pdb"
set LINK_FILE=
set LINK_LIB=
set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%"
set RSP_FILE_INDICATOR=@
rem ********************************************************************
rem Resource compiler parameters
rem ********************************************************************
set RC_COMPILER=rc /fo "%OUTDIR%mexversion.res"
set RC_LINKER=
set POSTLINK_CMDS=del "%LIB_NAME%.x" "%LIB_NAME%.exp"
set POSTLINK_CMDS1=mt -outputresource:"%OUTDIR%%MEX_NAME%%MEX_EXT%;2" -manifest "%OUTDIR%%MEX_NAME%%MEX_EXT%.manifest"
set POSTLINK_CMDS2=del "%OUTDIR%%MEX_NAME%%MEX_EXT%.manifest"
set POSTLINK_CMDS3=del "%OUTDIR%%MEX_NAME%%MEX_EXT%.map" ""
Kaustubha Govind
2012 年 3 月 5 日
You shouldn't need to change the mexopts.bat file - it looks like something is wrong with your compiler installation or System PATH variable. Did you install the x64 compilers as I suggested?
Nitin Reddy Ganna
2012 年 3 月 8 日
Yeah..
"Compiler: Microsoft Visual C++ 2010 Express
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
***************************************************************************
Warning: MEX-files generated using Microsoft Visual C++ 2010 require
that Microsoft Visual Studio 2010 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\Nitin\AppData\Roaming\MathWorks\MATLAB\R2011a\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2011a\bin\win64\mexopts\msvc100freeopts.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/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
************************************************************************** "
Kaustubha Govind
2012 年 3 月 9 日
Okay - it looks like this is going nowhere. I would recommend contacting Tech Support if you have a license that is on maintenance.
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
タグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
