Is it possible to access #define variables from header file after using clibgen?

1 回表示 (過去 30 日間)
Weston Griffin
Weston Griffin 2022 年 12 月 15 日
回答済み: Sarthak 2023 年 3 月 21 日
I created a C/C++ interface .dll using clibgen and build commands. I would like to also access the #DEFINE variables in the header files associated with the clib so that I can interpret errors returned by the functions. Is this possible (i.e., is it already in the clib LibraryDefinition) or do I need to parse the header file for the variables.

回答 (1 件)

Sarthak
Sarthak 2023 年 3 月 21 日
Hi Weston,
As per my understanding, #define variables are not accessible from the DLL itself. The values they define can be accessed from code that uses the DLL, by including the header file that contains the #define statements.
To access the values of #define statements in the header files associated with the clib, you can include the header file in your code using the #include directive, and then use the defined values in your code.

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by