Closed sevenb23 closed 1 year ago
It could have something to do with these lines: https://github.com/CESNET/libyang-cpp/blob/master/include/libyang-cpp/Enum.hpp#L295-L302
std::ostream& operator<<(std::ostream& os, const NodeType& type)
#if defined(__GNUC__) && !defined(__llvm__) && __GNUC__ <= 10
LIBYANG_CPP_EXPORT
#endif
;
std::ostream& operator<<(std::ostream& os, const ErrorCode& err)
#if defined(__GNUC__) && !defined(__llvm__) && __GNUC__ <= 10
LIBYANG_CPP_EXPORT
#endif
;
I'm not sure if apple arm needs the LIBYANG_CPP_EXPORT
macro or not. Although if you're using clang, then __llvm__
is surely defined? So maybe LIBYANG_CPP_EXPORT
is needed after all? Unfortunately, I don't have an Apple arm device to test this.
I got a similar error when building via GitHub CI with GCC 11.3 on OS X 13 (targetting 12.4), but this time for x86_64. I.e., a different compiler, and a different architecture:
FAILED: test_schema_node
: && /usr/local/bin/g++-11 -Wall -Wextra -pedantic -Woverloaded-virtual -Wimplicit-fallthrough -Wsuggest-override -O3 -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.4 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/test_schema_node.dir/tests/schema_node.cpp.o -o test_schema_node -Wl,-rpath,/Users/runner/work/oopt-gnpy-libyang/build-libyang-cpp libDoctestIntegration.a libyang-cpp.dylib && :
Undefined symbols for architecture x86_64:
"__ZN7libyanglsERSoRKNS_8NodeTypeE", referenced from:
__ZN7doctest6detail19stringifyBinaryExprIN7libyang8NodeTypeES3_EENS_6StringERKT_PKcRKT0_ in schema_node.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
I'll take a look into this.
@sevenb23 , does this patch work for you?
I'm trying to install on the below arm64-apple-darwin22.1.0. make stage breaks with the following error
Is the platform not supported ? compiler : Apple clang version 14.0.0 (clang-1400.0.29.202)