"Errors parsing header file" when building interface C++ library

4 ビュー (過去 30 日間)
Damien Laidin
Damien Laidin 2021 年 3 月 11 日
回答済み: Lokesh 2024 年 2 月 26 日
Hello,
I am trying to build an C++ interface library on macOS (I already have the build on Linux working). When comes the time to call clibgen.generateLibraryDefinition I get the following error (the list goes on a bit more but the errors are the same).
Error using generateLibraryDefinition (line 45)
Errors parsing header file.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:573:
type name is not allowed.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:573:
type name is not allowed.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:573:
identifier "__is_same" is undefined.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:582:
type name is not allowed.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:582:
type name is not allowed.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:582:
identifier "__is_same" is undefined.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:492:
incomplete type is not allowed.
/Users/MY_USER_NAME/Library/Developer/Toolchains/LLVM11.1.0.xctoolchain/usr/include/c++/v1/type_traits:492:
expected a ";".
Anyone knows how to fix that ?
  1 件のコメント
Boris
Boris 2022 年 7 月 18 日
Hi Damien, did you manage to solve your problem by any chance? I am having the very same problem, I am even trying with the official examples shipped with MATLAB but it just does not want the slighest include from the standard library.
See here my related question.

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

回答 (1 件)

Lokesh
Lokesh 2024 年 2 月 26 日
Hi Damien,
I understand that you are facing errors when building a C++ interface library on macOS. The issue you are encountering is due to the "clibgen.generateLibraryDefinition" function failing when parsing some header files on macOS.
Please refer to the following documentation, which provides a potential workaround to resolve a similar issue:

カテゴリ

Help Center および File ExchangeUse Prebuilt MATLAB Interface to C++ Library についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by