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

3 visualizzazioni (ultimi 30 giorni)
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 Commento
Boris
Boris il 18 Lug 2022
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.

Accedi per commentare.

Risposte (1)

Lokesh
Lokesh il 26 Feb 2024
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:

Community Treasure Hunt

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

Start Hunting!

Translated by