Errors when generating a MATLAB interface to a C++ library

5 ビュー (過去 30 日間)
Aleksandar
Aleksandar 2024 年 1 月 7 日
回答済み: Aleksandar 2024 年 1 月 11 日
Hello,
I'm having difficulties with generating a MATLAB interface to a C++ library GitHub - ORNL/TASMANIAN: The Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN. I'm using Ubuntu 22.04.3 LTS and MATLAB version 2023a. First, I build the Tasmanian library with CMake and GCC 11 and install it to a custom directory, which generates the header files in <install_dir>/include directory and library .so files in <install_dir>/lib directory. I then run the clibPublishInterfaceWorkflow function and in the Generate C++ Interface section select all the header files and .so files. When I click on Generate definition file, it prints "MEX configured to use 'g++' for C++ language compilation.", runs for some time, but exits with several errors like:
/usr/include/c++/11/bits/basic_string.h(6064):
error: declaration of function template "std::__cxx11::basic_string" had a different meaning during compilation of "<install_dir>/include/Tasmanian.h" (template types do not match)
or
/usr/include/c++/11/array(267):
error: declaration of function template "std::array" had a different meaning during compilation of "<install_dir>/include/Tasmanian.h" (template types do not match)
What could be the issue here?
  1 件のコメント
Aleksandar
Aleksandar 2024 年 1 月 8 日
I just found this thread which explains the same problem that I have:
I'll try the suggestion mentioned there and report back here.

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

採用された回答

Aleksandar
Aleksandar 2024 年 1 月 11 日
I can confirm that issues with multiple header files are not there on Windows either with mingw81 or Visual C++ 2022. However, I still haven't succeeded in generating the interface as Matlab taskes up more than 12GB of RAM and crashes (my system has 16GB, but apparently it's not enough). I'll open another thread for this issue.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall C++ from MATLAB についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by