<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Dear all, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">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. <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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:
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Error using ft_compile_mex>compile_mex_list<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Error using mex<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp:10:1: error: 'EXTERN_C' does not name a type<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">EXTERN_C mxArray* mxSerialize(mxArray const *);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">^~~~~~~~<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp:11:1: error: 'EXTERN_C' does not name a type<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">EXTERN_C mxArray* mxDeserialize(const void *, size_t);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">^~~~~~~~<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp: In function 'void mexFunction(int, mxArray**, int, const mxArray**)':<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">C:\Program Files\MATLAB\fieldtrip-20220104\src\mxSerialize_cpp.cpp:22:50: error: 'mxSerialize' was not declared in this scope<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">         plhs[0] = (mxArray *) mxSerialize(prhs[0]);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">                                                  ^<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Error in ft_compile_mex (line 114)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  compile_mex_list(L, ftpath, force);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance! <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best wishes,<br>
Sam <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">---<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">Dr.rer.nat. Samuel H. Cosper<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Postdoc<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Entwicklingspsychologie und Neurowissenschaft der Lebensspanne<br>
(Lifespan Developmental Neuroscience)<br>
Fakultät Psychologie (Faculty of Psychology)<br>
Zellescher Weg 17, Raum A229<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE">01062 Dresden<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Email: samuel.cosper@tu-dresden.de<br>
<br>
Technische Universität Dresden<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>