clibgen c++ on MacOS/MATLAB2019b cannot use standard library

7 vues (au cours des 30 derniers jours)
Boris
Boris le 6 Juil 2022
Hi all,
I am trying to bind c++ header-only to MATLAB, as described in the documentation.
It works for super-basic code, but from the moment I need the slighest include from the standard library, e.g. iostream, it throws a bunch of errors when clibgen tries to parse the file.
For example, this simple code pulls one the official cpp example (and therefore theoretically works) and tries to compile it:
copyfile(fullfile(matlabroot,'extern','examples','cpp_interface','school.hpp'),'.','f')
clibgen.buildInterface("school.hpp") % buildInterface can be replace by generateLibraryDefinition it leads to the same error
and it leads to the error displayed in full at the end of this message.
I am on MacOSX12.3, on a MacBook Pro 2020 with an intel chip and latest Xcode (clang 13 I believe) using MATLAB 2019b
Does anyone has a workaround that issue?
Errors parsing header file.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: identifier
"__is_same" is undefined.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:590: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:590: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:590: identifier
"__is_same" is undefined.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:491: incomplete type
is not allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:491: expected a ";".
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:1009: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:1009: identifier
"__is_function" is undefined.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/tuple:1004: parameter pack "_Tp"
was referenced but not expanded.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/tuple:1023: parameter pack "_Tp"
was referenced but not expanded.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:581: type name is not
allowed.

Réponses (0)

Tags

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by