我在 OS X 10.8 的 MATLAB R2011a 下运行 mex。编译过程几乎可以。但是我遇到了一些链接错误。我在 MATLAB 命令窗口中使用的命令行是:
mex -I/usr/include/ -L/usr/lib/ -O -DDEBUG -DFASTPLOG CalcEntropyScalesOpt.c Hists.c
在 MS Windows 中运行良好的原始命令行是
mex -O -DDEBUG -DFASTPLOG CalcEntropyScalesOpt.c Hists.c
我添加了那些 -I 和 -L 选项来修复一些错误。但是链接错误依然存在:
Undefined symbols for architecture x86_64:
"_mxCreateDoubleMatrix_700", referenced from:
_do_CalcSalScale1DAA in CalcEntropyScalesOpt.o
_do_CalcSalScale3D in CalcEntropyScalesOpt.o
_do_CalcSalScale2D in CalcEntropyScalesOpt.o
_do_CalcSalScale1DParzen in CalcEntropyScalesOpt.o
_do_CalcSalScale1D in CalcEntropyScalesOpt.o
"_mxCreateNumericArray_700", referenced from:
_AACirclePix in CalcEntropyScalesOpt.o
_CirclePix2 in CalcEntropyScalesOpt.o
... many more like this ...
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
mex: link of ' "CalcEntropyScalesOpt.mexmaci64"' failed.
我想我需要更多的 -l 或 -L 选项,但不知道在那里写什么。
谢谢。
问候,理查德