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

5 vues (au cours des 30 derniers jours)
Aleksandar
Aleksandar le 7 Jan 2024
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 commentaire
Aleksandar
Aleksandar le 8 Jan 2024
I just found this thread which explains the same problem that I have:
I'll try the suggestion mentioned there and report back here.

Connectez-vous pour commenter.

Réponse acceptée

Aleksandar
Aleksandar le 11 Jan 2024
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.

Plus de réponses (0)

Catégories

En savoir plus sur Call C++ from MATLAB dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by