MATLAB Answers

0

DLL from MinGW has different architecture than the host

Asked by Luis Ruiz on 28 May 2019
Latest activity Commented on by Luis Ruiz on 7 Jun 2019
I am using MinGW to create a shared library, so the shared library is created with extension DLL, and I can use it to link programs in Windows.
But when I try to load the library using loadlibrary, I get a message "has different architecture than the host". Thus, the library cannot be loaded.
If my library was crerated using MinGW and that is teh compiler used by MATLAB why it cannot load the library?

  0 Comments

Sign in to comment.

Products


Release

R2018a

1 Answer

Answer by Etsuo Maeda on 7 Jun 2019

This is a limitation of loadlibrary function.
loadlibrary does not support libraries generated by the MATLAB Compiler SDK™ product.
HTH

  1 Comment

Actually it can be done. But you need to use the Matlab MinGW64 compiler. I did it with a simple library that adds two numbers.

Sign in to comment.