How do I compile an Engine program using MSVC 6.0 or earlier and MATLAB 6.0 (R11) or earlier?

1 view (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Jan 2010
We have some pre-built example project files that will help you to get started with compiling Engine programs in MSVC 6.0. These are available in the attached enginezip file.
To use these files, download and run the "enginezip.zip" file and read the README file contained therein.
If you are using MSVC 5.0, or the files above do not appear to be working on your system, the best option is to follow these steps that will set up a project to compile Engine programs in MSVC 5 and 6.
1. Start up MSVC 5.0 or 6.0.
2. Go to File --> New. Click on Projects tab, and select Win32 Windows Application
3. In Project name, type engwindemo. Platforms should be filled in with Win32. Click OK
4. Select the File View tab; then right click on Workspace 'engwindemo':1 project(s) and select Add New Project to Workspace
5. Click on the Projects tab, and select Win32 Static Library
6. Under Project name, type libmx
7. Select Add to current workspace
8. Dependency of should be checked, and engwindemo should be selected in the listbox
9. Platforms should be filled with Win32. Click OK
10. Repeat steps 4 to 9 for libmat and libeng. Replace libmx with the appropriate names.
11. Select engwindemo files. Right click and select New Folder. In the Name of the new folder, type Sources. Click OK.
12. Repeat step 11 for libeng files, libmat files, and libmx files.
13. Double-click on engwindemo files, select Sources.
14. Right click on sources, go to Add Files to Folder. Browse to $MATLAB/extern/examples/eng_mat folder (where $MATLAB is the root MATLAB directory), and select engwindemo.c. Click OK.
15. Double-click on libeng files. Right click on Sources, and go to Add Files to Folder. Browse to $MATLAB/extern/include, and select libeng.def. Click OK.
16. Repeat step 15 for libmx files and libmat files. Replace libeng with the appropriate names.
17. Double click on libmat files and double click on Sources. Right click on libmat.def and select Settings. This brings up a Project Settings window. Click on Custom Build Tab. In the Build Command(s) field enter:
lib /def:"$MATLAB\extern\include\libmat.def" /machine:ix86 /OUT:libmat.lib
$MATLAB represents the root directory where MATLAB is installed on your system; please use your exact root MATLAB directory in place of "$MATLAB" in the above command.
In the Output file(s) field type: libmat.lib.
Click OK.
17A. Repeat step 17 for libeng files and libmx files. Replace libmat with the appropriate names.
18. Highlight engwindemo files and right click. Select Settings. Click on the C/C++ Tab. In the Category listbox select Code Generation. In the Use Runtime library listbox select Multithreaded DLL. Change the Category listbox to Preprocessor. Add to the Preprocessor definitions MSVC, MSWIND, IBMPC so:
WIN32,_DEBUG,_WINDOWS,_MBCS
changes to:
WIN32,_DEBUG,_WINDOWS,_MBCS,MSVC,MSWIND,IBMPC
Add to the Additional include directories field:
$MATLAB\extern\include;
19. Select engwindemo files, right click and Set as Active Project
20. Go to Build and Rebuild All.
21. You should now have engwindemo.exe.

More Answers (0)

Categories

Find more on Search Path in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!