Problem With MEX files and DLLs

5 views (last 30 days)
So I have been getting the same error for every mex file I've attempted to run. To be clear I wrote a program with a bunch of mex files in it on another computer and then transferred that program to multiple computers. On all of the computers it works except for one where I get the following error message for every single MEX file in the program.
Invalid Mex File <name of mex>.mexw64:
Missing symbol
'?to_ustring@i18n@fl@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEBD@Z' in
'<path to MATLAB>\MATLAB\R2017b/bin/win64\libmwi18n.dll' required by
'<path to mex>\<name of mex>.mexw64'.
Does anyone know how to fix this problem?
  4 Comments
Walter Roberson
Walter Roberson on 2 Nov 2017
By the way, the above demangles to
class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl fl::i18n::to_ustring(char const * __ptr64)
In short, it is having trouble finding fl::i18n::to_ustring in libmwi18n.dll
Jacob Mevorach
Jacob Mevorach on 3 Nov 2017
Edited: Jacob Mevorach on 3 Nov 2017
Would there be any way to possibly modify the current version of libmwi18n.dll so that it would work with my code?

Sign in to comment.

Accepted Answer

James Tursa
James Tursa on 2 Nov 2017
Edited: James Tursa on 2 Nov 2017
In general, compiled mex routines are not guaranteed to be compatible between different versions of MATLAB. E.g., the functions available in the libraries can change. If the earlier version is missing a library routine that the mex routine compiled with the later version is relying on, your only hope is probably to recompile the mex routine on the older computer.
What versions of MATLAB are being used on the other computers where it works?
  3 Comments
James Tursa
James Tursa on 3 Nov 2017
Why can't you use multiple versions of your compiled code?
Jacob Mevorach
Jacob Mevorach on 3 Nov 2017
It's lengthy and split up into many different functions interspersed in a large program due to the fact that much of the code linking up these functions can't be turned into C/C++. It would be around a full day of re-compiling everything using the MATLAB coder. And even then if the functionality changed slightly it could throw things off. I might conceivably have to do this the next time a MATLAB release comes out and I don't think there will be any noticable improvement benefits for my specific program by going from 2017a to 2017b.
I was hoping there would be a quick fix that would make all future versions of MATLAB back compatible with MEX files compiled on earlier versions but I guess that won't be the case which is rather unfortunate.
Thank you for your help however, I greatly appreciate it.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler 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!