"Errors parsing header file" when building interface C++ library
4 views (last 30 days)
Show older comments
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 Comment
Boris
on 18 Jul 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.
Answers (1)
Lokesh
on 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:
0 Comments
See Also
Categories
Find more on Use Prebuilt MATLAB Interface to C++ Library in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!