DLL from MinGW has different architecture than the host

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?

回答 (1 件)

Etsuo Maeda
Etsuo Maeda 2019 年 6 月 7 日

1 投票

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

1 件のコメント

Luis Ruiz
Luis Ruiz 2019 年 6 月 7 日
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.

サインインしてコメントする。

製品

リリース

R2018a

質問済み:

2019 年 5 月 28 日

コメント済み:

2019 年 6 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by