我有一個爲MATLAB編寫的自定義DLL,它在我們的開發機器上工作正常。然而,當我嘗試一個乾淨的機器,沒有開發工具上,我得到的消息:MATLAB的自定義C DLL - 加載庫錯誤
>> loadlibrary CMatLab CMatLab.h
??? Error using ==> loadlibrary at 279
Microsoft Visual C++ 2005 or 2008 is required to use this feature.
一些研究,它似乎很清楚,一個編譯器必須解析運行時的頭文件之後,所以我安裝了標準的Windows SDK,運行mex -setup
來選擇編譯器,但我仍然得到相同的錯誤信息。這是我爲選擇編譯器所做的。
>> mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? mex -setup
Select a compiler:
[1] Microsoft Visual C++ 2008 SP1 in C:\Program Files (x86)\Microsoft Visual Studio 9.0
[0] None
Compiler: 1
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\adriane\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat
From template: D:\Matlab\bin\win64\mexopts\msvc90opts.bat
Done . . .
我真的不希望這臺機器上安裝Visual Studio,因爲它降低了它的實用性,作爲釋放測試平臺建立我們其他的工具和軟件。任何想法的人?我發現其他人也有同樣的問題,但我沒有看到明確的解決方案。操作系統是Windows 7專業版64位。該DLL是用VS2008構建的。
爲什麼要投票? – ExpatEgghead
不是一個明顯的解決方案。好的問題和答案。開發機器測試機器的過程很好理解。 – chappjc