Error using loadlibrary while trying to load okFrontPaneldll.h

1 回表示 (過去 30 日間)
Aaryan Tiwary
Aaryan Tiwary 2023 年 7 月 9 日
回答済み: Kirthi 2023 年 7 月 12 日
This exact same code works on my colleague's computer but throws this error on mine. I am unable to understand the origin of the error by looking at this output. Could someone explain?
  1 件のコメント
lingso
lingso 2023 年 7 月 10 日
I don't know why, I'm also looking for the answer!

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

回答 (1 件)

Kirthi
Kirthi 2023 年 7 月 12 日
Hello, please try one of the below workflows:
1) User's header file needs to include "windows.h" in order to compile, which is a requirement in "loadlibrary". Just add the following line in your header file: #include "windows.h"
2) "loadlibrary" does not support many C language constructs. Check the links below for a non-exhaustive list of limitations:
It is possible to receive this error when using "loadlibrary" on a library that does not violate any of the limitations detailed in the links above. Unfortunately, not all limitations are documented. For example, "loadlibrary" will not work on a function that takes an array of structs as a function input or output.
To add, the MATLAB C++ interface has much broader support for C/C++ constructs: https://www.mathworks.com/help/matlab/call-cpp-library-functions.html?s_tid=CRUX_lftnav.

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by