1

我正在尝试使用一个名为 edfImport 的函数(可在此处获得:http: //kobi.nat.uni-magdeburg.de/edfImport

为了使用该功能,我必须首先运行 edfCompile(包含在工具包中)。运行 edfCompile 时,出现错误:

??? Error using ==> mex
Unable to complete successfully

我正在运行 MATLAB 7.1 (R14) 并为我的编译器安装了最新版本的 MinGW、Cygwin 和 Gnumex(根据此页面上的说明:http: //ptolemy.eecs.berkeley.edu/ptolemyII/ptII4.0/ cygwin.htm )

我能够编译示例 mex 文件,但我仍然不相信这不是我的编译器设置方式的问题。感激地收到任何提示。很高兴知道其他人是否也无法运行 edfCompile... (http://kobi.nat.uni-magdeburg.de/edfImport)

非常感谢

编辑:完整的错误消息:

In file included from edfMexImport.cpp:6:0: 
EDFFile2.h:37:39: error: 'mwSize' has not been declared 
EDFFile2.h:127:45: error: 'mwIndex' has not been declared 
edfMexImport.cpp: In function 'void mexFunction(int, mxArray**, int, const mxArray**)': 
edfMexImport.cpp:12:3: error: 'mwSize' was not declared in this scope 
edfMexImport.cpp:12:10: error: expected ';' before 'OutputDims' 
edfMexImport.cpp:48:12: error: expected ';' before 'OptionsDimN' 
edfMexImport.cpp:49:9: error: 'OptionsDimN' was not declared in this scope 
edfMexImport.cpp:51:13: error: 'OptionsDim' was not declared in this scope 
edfMexImport.cpp:51:33: error: expected primary-expression before ')' token 
edfMexImport.cpp:51:34: error: expected ';' before 'mxGetDimensions' 
edfMexImport.cpp:73:12: error: expected ';' before 'FlagsDimN' 
edfMexImport.cpp:74:9: error: 'FlagsDimN' was not declared in this scope 
edfMexImport.cpp:76:13: error: 'FlagsDim' was not declared in this scope 
edfMexImport.cpp:76:31: error: expected primary-expression before ')' token 
edfMexImport.cpp:76:32: error: expected ';' before 'mxGetDimensions' 

C:\PROGRAM FILES\MATLAB71\BIN\MEX.PL: Error: Compile of 'edfMexImport.cpp' failed. 

??? Error using ==> mex
Unable to complete successfully

Error in ==> edfCompile at 15
eval(sprintf('mex -I''%s'' edfMexImport.cpp EDFFILE2.cpp ''%s/edfapi.lib''', edfapiIncludesFolder, edfapiLibraryFolder));
4

3 回答 3

2

看起来缺少一些类型定义,尤其是mwSizeandmwIndex类型。您可以将以下内容添加到 EDFFile2.h 并重试吗?

略低于

#include "edf.h"
#include <mex.h>

添加这个:

#ifndef mwSize
    #define mwSize int
#endif

#ifndef mwIndex
    #define mwIndex int
#endif
于 2012-05-21T12:57:31.153 回答
1

MEX 文件已修改为支持 64 位“大型数组处理 API”,如本文档中所述:

http://www.mathworks.com/support/solutions/en/data/1-5C27B9/

请注意,这个可选的大变量支持最初是在 R7.3 (2006b) 中添加的,您的版本甚至更旧。基本上,对于 MEX 文件使用的 API,您的 MATLAB 太旧了。也就是说,如果 MEX 文件足够简单,Gunther 的解决方案可能是将 MEX 文件“反向移植”到旧 MATLAB 的简单答案。mxGetDimensions() 之类的函数现在返回 mwSize*,但以前返回 int*。

因此,如果可以的话,请升级 MATLAB,否则请尝试 Gunther 的答案,让我们知道它是如何进行的。

于 2012-05-21T13:18:19.170 回答
0

你看过 edfCompile.m 吗?不幸的是,我的 PC 上没有安装 Matlab,所以我只能建议您尝试编译这两个 .cpp 文件edfMexImport.cppEDFFILE2.cpp手动使用edfapi.lib

于 2012-05-18T18:30:29.660 回答