Filter löschen
Filter löschen

Create prototypes to wrap agains C-Interface DLL - How universal ist the pcwin64.dll created?

3 Ansichten (letzte 30 Tage)
I wrote a wrapper for a dll with c interface. My plan is to ship this wrapper and the dll to other people. I came across that by creating a prototype file the speed for loading the dll (via loadlibrary) increases enormously. Additonally, I noticed another advantage: to load the dll via header file on 64 bit systems I usually needed an additional third party compiler (e.g. vc from microsoft), which was a really big drawback.
With the prototype file this restriction seems vanish (not form me creating the prototype file but for the people who will use it). I did some test to check if my solution runs on other different platforms. So far, my tests were successful. I am planing to ship the following files:
  • someWrapperFiles.m (pure MATLAB code)
  • myDll.dll
  • myDll_prototype.m (for 32bit MATLAB)
  • myDll_prototype_x64.m (for 64bit MATLAB)
  • myDll_thunk_pcwin64.dll (for 64bit MATLAB)
Now, my question is: How universal are are the "myDLL_Protoype.m", "myDll_prototype_x64.m", "myDll_thunk_pcwin64.dll" files to other windows platforms. Do they work on all current windows platforms (Win Vista, Win7, Win8, Win10) in 32 and 64bit versions, on Intel and AMD Hardware? Or are there any restricitions. And, is it always possible to use the dll without an additional compiler if the protoype file once created? Even if the MATLAB version is not 2016a?
Thank you in advance for your answers.

Antworten (1)

Philip Borghesani
Philip Borghesani am 8 Mär. 2016
The shipping the generated prototype file and compiled thunk file is the recommenced way to distribute code that uses loadlibrary and the only way to do so with the MATLAB compiler.
The prototype file and thunk dll are only guaranteed to work with the MATLAB version they are built with. The version of Windows and processor make do not matter but you may need to make sure any c run-time for the compiler you used is installed on the customers machine. The thunk file is specific to 64 bit MATLAB but a thunk file is not needed for 32bit MATLAB. The prototype file may work with 32bit MATLAB but there are no guarantees it is best go generate a new one and test with 32 bit MATLAB if you wish to support it. there are a few places where compatibility problems occur with calllib code and 32/64 bit platform changes.
We do not guarantee that the thunk file and prototype file will work with other releases of MATLAB but they likely will, there have been few changes to the api's used for these file recently. If you want to guarantee it works for your application you need to test it.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by