

Matlab 64 bit dll archive#
When the Matlab component consuming the native DLL is deployed, the loadlibrary call is made from wherever the CTF archive was extracted to – and it occasionally fails to find the thunk dll. Here’s, briefly, another one that was useful to us. This discussion can lead to all sorts of other workarounds and solutions. Based on my own experience, I can suggest sort of an answer. The question remains, who in their right mind would try to parse a header with a perl script.
Matlab 64 bit dll 32 bit#
Yet, when I generate a dll using the Matlab Compiler, I get a 32 bit dll. I use Matlab R2016b and I downloaded Matlab Runtime for Matlab R2016b. When it doesn’t, they sometimes document the root cause as unsupported. I made a very simple Matlab function and generated a dll (.Net Assembly). Most of the time it succeeds (on C++ headers too), sometimes it doesn’t. Now I have exactly zero insight into Mathworks considerations and decisions, but I have this vague suspicion the only reason for these half-hearted ‘C-only’ limitations is that they’re stuck with this essentially black-box perl script that parses headers.
Matlab 64 bit dll software#
I get the following error: My compiler is Microsoft Software Development Kit (SDK) 7.1. Solves plenty of other C/C++ idiosyncrasies too. Hi, I have three 64bit files (XPSC8DRIVERS.dll, XPSC8DRIVERS. In the immortal words of Todd Howard, It just works. The workaround I used, both in this toy scenario and in the real life DLLs I wanted to load into Matlab, was – grab the perl-generated sources, rename them to cpp and build your own thunk.dll. The root issue is that for whatever reason the perl script generates a c file, not a cpp one. We didn’t violate any of loadlibrary’s documented limitations but we already have enough visibility into the process to understand what’s going on. Googling shows only that this seems to be an open question online as well. One could do with this terse phrasing until something goes wrong – as it inevitably does. …Ī thunk file is a compatibility layer to a 64-bit library generated by MATLAB. The documentation says nearly nothing about either proto files or thunk files:Ī prototype file is a file of MATLAB commands which you can modify and use in place of a header file. When the proper loadlibrary call is made, a proto.m file is generated along with something named ***_pcwin64_thunk.dll (well, on 圆4 pc’s, obviously).

To help parse the external dll contents you’d need to initially provide loadlibrary a C/C++ header file, but you can then tell loadlibrary to transform this header info into a Matlab-native representation typically named a ***proto.m file. Matlab provides several ways to call into external native code – if you have just the binaries for this code, the way is loadlibrary. Today we’ll try to shed some light on dark undocumented corners of Matlab’s external interfaces. First, we use visual studio 2008 to open the project: remoteApiSharedLib.vcproj, and rebuild all of them, and finally, we get new remoteApi.dll.
