MEX files do not work on a network drive on Windows
Show older comments
I am trying to develop MEX files using the IDE within Microsoft Visual Studio 2022. I am using the templates provided by https://marketplace.visualstudio.com/items?itemName=gharveymn.MEXFunctionTemplates. I am starting with a simple MEX file - I have tried "C:\Program Files\MATLAB\R2024a\extern\examples\cpp_mex\arrayProduct.cpp" and "C:\Program Files\MATLAB\R2024a\extern\examples\mex\arrayProduct.c". I successfully build the .mexw64 file and copy it to an empty directory on my C drive. The MEX file works as expected.
However, if instead I copy the .mexw64 file to a network directory and then add that directory to the Matlab path, the MEX file does not work. Matlab seemingly hangs along with the rest of Windows. My only path to recovery is a hard reset via the power button. I have tried mapping the network directory to a drive letter to no avail.
Any suggestions for a fix would be greatly appreciated. I realize I could build these simple MEX files with the mex command in Matlab, but my goal is to next build a MEX file that calls other libraries. Developing within Visual Studio has worked well for me in the past (pre-2017). The ability to provide additional include directories, additional library directories, additional library filenames, etc. within the IDE is valuable. I also have previously been able to perform debugging within VS as well. But right now I can't get even these very basic MEX files to compile without adding the additional stuff in.
Thanks!
7 Comments
Eric
on 21 Aug 2024
Eric
on 21 Aug 2024
Eric
on 21 Aug 2024
dpb
on 22 Aug 2024
Tough for issues like this from afar, but I'll axe a Q? anyway...were you able successfully map a drive to the problem network? If so, do ordinary m-files on that network work or is it only mex-files? I know MATLAB doesn't deal with network path names gracefully at all, but I've had success mapping drives in Windows...
Eric
on 22 Aug 2024
If your IT folks don't have a klew (which they probably won't given it appears to be MATLAB-specific), I'd suggest submitting an official bug/support request to TMW.
I had a machine crash a while back and haven't yet gotten compilers installed to be able to try a test case with the mapped network drive here and, unfortunately, don't have the time right now to go do that, sorry.
Eric
on 22 Aug 2024
Answers (1)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!