概述
修改Matlab的mexopts.bat包括常用包含路径与库
打开文件:
C:UsersAdministratorAppDataRoamingMathWorksMATLABR2012amexopts.bat
修改内容如下:
@echo off
rem MSVC100OPTS.BAT
rem
rem Compile and link options used for building MEX-files
rem using the Microsoft Visual C++ compiler version 10.0
rem
rem $Revision: 1.1.6.3 $ $Date: 2011/03/09 05:35:31 $
rem Copyright 2007-2009 The MathWorks, Inc.
rem
rem StorageVersion: 1.0
rem C++keyFileName: MSVC100OPTS.BAT
rem C++keyName: Microsoft Visual C++ 2010
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 (x86)Microsoft SDKsWindowsv7.0A
set PATH=%VCINSTALLDIR%binamd64;%VCINSTALLDIR%bin;%VCINSTALLDIR%VCPackages;%VSINSTALLDIR%Common7IDE;%VSINSTALLDIR%Common7Tools;%LINKERDIR%binx64;%LINKERDIR%bin;%MATLAB_BIN%;%PATH%
set INCLUDE=%VCINSTALLDIR%INCLUDE;%VCINSTALLDIR%ATLMFCINCLUDE;%LINKERDIR%include;C:opencv24opencvbuildinclude;C:opencv24opencvbuildincludeopencv2gpu;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv4.2include;C:Program
FilesNVIDIA GPU Computing ToolkitCUDAv4.2include;%INCLUDE%
set LIB=%VCINSTALLDIR%LIBamd64;%VCINSTALLDIR%ATLMFCLIBamd64;%LINKERDIR%libx64;%MATLAB%externlibwin64;C:opencv24opencvbuildgpux64vc10lib;C:opencv24opencvbuildx64vc10lib;C:Program FilesNVIDIA GPU Computing
ToolkitCUDAv4.2libx64;%LIB%
set MW_TARGET_ARCH=win64
rem ********************************************************************
rem Compiler parameters
rem ********************************************************************
set COMPILER=cl
set COMPFLAGS=/c /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%externlibwin64microsoft
set LINKER=link
set LINKFLAGS=/dll /export:%ENTRYPOINT% /LIBPATH:"%LIBLOC%" /forcelibmx.lib libmex.lib libmat.lib opencv_core241.lib opencv_highgui241.lib opencv_imgproc241.lib opencv_gpu241.lib cudart.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"
之后,编译Opencv程序直接用命令:mex opencvtest1.cpp即可;
Cuda连接的问题还得再实验。
最后
以上就是时尚长颈鹿为你收集整理的matlab包含路径下函数,批改Matlab的mexopts.bat包括常用包含路径与库的全部内容,希望文章能够帮你解决matlab包含路径下函数,批改Matlab的mexopts.bat包括常用包含路径与库所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复