MEX access denied error

28 次查看(过去 30 天)
David May
David May 2015-3-19
回答: David May 2015-4-2
I am developing a portable tool for use out in the field (no network connection), and apparently I managed to either stumble onto a bug or corrupt something in my mcr install to where I get a error message for all of my compiled programs:
Invalid MEX-file
'C:\Users\DAVID~.NAD\AppData\Local\Temp\1\david.l.may1\mcrCache8.1\LHTool1\toolbox\shared\statslib\@categorical\private\issqrbktliteral.mexw64': Access is denied.
Error in => LHTool.m at line 122
Where line 122: gui_mainfcn(gui_State, varargin{:});
At first I suspected this was just a problem with the code I had written (which was error free for all other uses), however I discovered I was unable to run any previous version of the executable that I had compiled which had previously worked before I encountered the error.
The build log files indicate that the package tool is removing authorization files: Deleting 12 temporary MEX authorization files. Removing: 'C:\Users\DAVIDL~1.NAD\AppData\Local\Temp\1\mathworks_tmp_13540_5489_13540.auth'. Removing: 'C:\Users\DAVIDL~1.NAD\AppData\Local\Temp\1\mathworks_tmp_13540_32491_13540.auth'. And so on...
I can navigate to the file indicated by the error message. The files are encrypted as expected, and I do have full permissions for the files. Running the function in MATLAB returns the same error that access is denied. It appears that the problem is limited to the Statistics toolbox private functions.
My question is how do I restore access to the MEX files such that I can run the programs again? I have tried deleting the temporary files, but that does not fix the problem. I am thinking a clean install of MATLAB and the MCR will be necessary, but I want to see if there is a fix before I call the IT guys for a reinstall on my machine.
I am using MATLAB R2013a x64, compiler v4.18.1
  1 个评论
David May
David May 2015-4-1
Additionally, there was an update to Java (specifically to version 1.7.0 update 76) prior to this problem surfacing. I can compile the program using various mcc options, all of which successfully build the project and still return the same Access Denied error for the same mex function when run.

请先登录,再进行评论。

回答(1 个)

David May
David May 2015-4-2
Ok, so I found a workaround to this issue.
From my experiments with separate code, there is something present in my project code that results in a temporary hidden file (*deploy*) that was not appearing. This results in the failure of the exe to unpack all the temporary files, and the program crashes.
The workaround is to specify that a separate CTF archive be built (Project>Settings, uncheck Embed CTF archive into application). This builds a permanent mcr folder in the executable folder instead of the temporary folder that is hidden deep in temporary folders.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by