[FieldTrip] Mex file issue

Samuel Harris Cosper samuel.cosper at tu-dresden.de
Wed Oct 5 10:30:10 CEST 2022


Dear all,



I am having an issue, as seems to be a common occurrence, with mex files and fieldtrip. I have double checked that "mex -setup" is working correctly and have also installed the MATLAB Support for MinGW-w64 C/C++ Compiler (version 22.1.0) already (in Matlab 2022a). I have also installed the most recent version of Fieldtrip on the Website/github.  Another important factor: I have ran this exact script before on many computers with no issue. Only on my new laptop (windows 10) am I running into this issue. I have made sure that all updates are installed.



Now to my issue. When running ft_timelockstatistics with all of the proper cfg configurations, I receive an error message "Invalid MEX-file 'C:\Program Files\MATLAB\fieldtrip-20220104\private\combineClusters.mexw64': The specified module could not be found."



I then ran "ft_compile_mex(true)". Everything seemed to be working until "Compiling MEX file src/mxSerialize_cpp ... Building with 'MinGW64 Compiler (C++)'." And I received the following error:



Error using ft_compile_mex>compile_mex_list

Error using mex

C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp:10:1: error: 'EXTERN_C' does not name a type

EXTERN_C mxArray* mxSerialize(mxArray const *);

^~~~~~~~

C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp:11:1: error: 'EXTERN_C' does not name a type

EXTERN_C mxArray* mxDeserialize(const void *, size_t);

^~~~~~~~

C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp: In function 'void mexFunction(int, mxArray**, int, const mxArray**)':

C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp:22:50: error: 'mxSerialize' was not declared in this scope

         plhs[0] = (mxArray *) mxSerialize(prhs[0]);

                                                  ^





Error in ft_compile_mex (line 114)

  compile_mex_list(L, ftpath, force);



Is there a solution to this issue? I have looked online, but was unsuccessful, particularly for Matlab 2022a and with the newest version of Fieldtrip.



Thanks in advance!



Best wishes,
Sam



---

Dr.rer.nat. Samuel H. Cosper

Postdoc

Entwicklingspsychologie und Neurowissenschaft der Lebensspanne
(Lifespan Developmental Neuroscience)
Fakultät Psychologie (Faculty of Psychology)
Zellescher Weg 17, Raum A229

01062 Dresden



Email: samuel.cosper at tu-dresden.de

Technische Universität Dresden



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20221005/2541b41e/attachment.htm>


More information about the fieldtrip mailing list