【设置编译器,系统是winXP,安装有VC++6.0,C++.NET 2010,下载的LIBSVM最新版3.18】
>> mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc C version 2.4.1 in D:\MATLAB71\sys\lcc
[2] Microsoft Visual C/C++ version 7.1 in C:\Program Files\Microsoft Visual Studio .NET 2003
[3] Microsoft Visual C/C++ version 6.0 in D:\Microsoft Visual Studio
[0] None
Compiler: 3
Please verify your choices:
Compiler: Microsoft Visual C/C++ 6.0
Location: D:\Microsoft Visual Studio
Are these correct?([y]/n): y
Try to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R14SP3\mexopts.bat
From template: D:\MATLAB71\BIN\win32\mexopts\msvc60opts.bat
Done . . .
***************************************************************************
Warning: The file extension of 32-bit Windows MEX-files was changed
from ".dll" to ".mexw32" in MATLAB 7.1 (R14SP3). The generated
MEX-file will not be found by MATLAB versions prior to 7.1.
Use the -output option with the ".dll" file extension to
generate a MEX-file that can be called in previous versions.
For more information see:
MATLAB 7.1 Release Notes, New File Extension for MEX-Files on Windows
***************************************************************************
【开始编译,一长串华丽的报错,吓得菜鸟我瑟瑟发抖,望大侠指导,万谢,万谢】
先后使用了VC6和.NET平台编译都报差不多相同的错误。
当前目录已设置在 libsvm/matlab ;
搜索目录也添加完毕。
>> make
Warning: argeArrayDims specified with -l option not found on -L path
libsvmread.c
libsvmread.c(64) : error C2065: 'mwIndex' : undeclared identifier
libsvmread.c(64) : error C2065: 'ir' : undeclared identifier
libsvmread.c(64) : error C2065: 'jc' : undeclared identifier
libsvmread.c(64) : error C2100: illegal indirection
libsvmread.c(65) : error C2143: syntax error : missing ';' before 'type'
libsvmread.c(122) : error C2065: 'labels' : undeclared identifier
libsvmread.c(122) : warning C4047: '=' : 'int ' differs in levels of indirection from 'double *'
libsvmread.c(123) : error C2065: 'samples' : undeclared identifier
libsvmread.c(123) : warning C4047: '=' : 'int ' differs in levels of indirection from 'double *'
libsvmread.c(124) : warning C4047: '=' : 'int ' differs in levels of indirection from 'int *'
libsvmread.c(125) : warning C4047: '=' : 'int ' differs in levels of indirection from 'int *'
libsvmread.c(131) : error C2109: subscript requires array or pointer type
libsvmread.c(131) : error C2106: '=' : left operand must be l-value
libsvmread.c(142) : error C2109: subscript requires array or pointer type
libsvmread.c(142) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
libsvmread.c(142) : error C2106: '=' : left operand must be l-value
libsvmread.c(158) : error C2109: subscript requires array or pointer type
libsvmread.c(158) : error C2064: term does not evaluate to a function
libsvmread.c(161) : error C2109: subscript requires array or pointer type
libsvmread.c(161) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data
libsvmread.c(161) : error C2106: '=' : left operand must be l-value
libsvmread.c(171) : error C2109: subscript requires array or pointer type
libsvmread.c(171) : error C2106: '=' : left operand must be l-value
D:\MATLAB71\BIN\MEX.PL: Error: Compile of 'libsvmread.c' failed.
If make.m fails, please check README about detailed instructions.
>>