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

조회 수: 7 (최근 30일)
Boris
Boris 2022년 7월 6일
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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Build MATLAB Interface to C++ Library에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by