MS Visual Studio property sheet for building MEX function

バージョン 1.2.0.0 (1.5 KB) 作成者: Kesh Ikuma
Using Property Sheet to make VS project configuration easy
ダウンロード: 901
更新 2012/10/24

ライセンスの表示

Note: This solution works to develop MEX functions with Visual Studio 2012 (which is not supported by 'mex' prior to 2013A release)

As outlined by Mathworks (http://www.mathworks.com/help/matlab/matlab_external/custom-building-mex-files.html#f24571) MEX functions can be developed in Visual Studio (or Visual C++). Setting up a VS project for each and every MEX function (and maintaining the projects' integrity over biyearly MATLAB updates) quickly becomes cumbersome. Visual Studio's Property Sheet feature gives us an easy way to keep all MEX project settings in one place.

Matlab_Mex_Build.props contains all the configurations necessary to make a DLL project into MEX project. Follow "How to create a MEX project in VS" below for the usage, and read "How to change MATLAB paths" below to set newly created macro "MatlabExternDir".

How to create a new MEX project in VS:
1. Create an empty C++ Win32 DLL project.
2. Go to Property Manager (accessible from View menu or behind Solution Explorer tab)
3. Right click on the created project name, click on "Add Existing Property Sheet...". In the dialog window, choose the downloaded and unzipped "Matlab_Mex_Build.props"
4. Add a source code file to the project and begin programming!

How to change MATLAB paths:
1. Open "Matlab_Mex_Build.props" in a text editor (recommend VS as it gives you XML color coding)
2. Look for <MatlabExternDir>. There are 2 in the file: one for Win32 and another for x64. Modify the applicable MatlabExternDir according to the installed Matlab version (or both if you have both 32- and 64-bit versions of MATLAB installed)

引用

Kesh Ikuma (2024). MS Visual Studio property sheet for building MEX function (https://www.mathworks.com/matlabcentral/fileexchange/38720-ms-visual-studio-property-sheet-for-building-mex-function), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2012b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.2.0.0

Edited "General Information" text

1.0.0.0