小弟根据http://www.vckbase.com/document/viewdoc/?id=1489做COM组件的例子逐条编译,在编译前先设置系统环境变量,并使用mbuild -setup命令链接编译器,情况如下:
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
Would you like mbuild to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc C version 2.4.1 in C:\APPLICATION\MATLAB\sys\lcc
[2] Microsoft Visual C/C++ version 6.0 in D:\Program Files
[0] None
Compiler: 2
Please verify your choices:
Compiler: Microsoft Visual C/C++ 6.0
Location: D:\Program Files
Are these correct?([y]/n): y
Warning: Mbuild requires that the Microsoft Visual C++ 6.0
directories "VC98" and "Common" be located within the same parent directory.
(Expected to find a directory named "Common" in the directory 'D:\Program Files'.)
Try to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R14SP3\compopts.bat
From template: C:\APPLICATION\MATLAB\BIN\win32\mbuildopts\msvc60compp.bat