Closed heri16 closed 2 years ago
The lines 15,16 include that. Maybe you have EIXX_MARSHAL_ONLY=ON
?
Symbols in shared library:
symbols -arch x86_64 /usr/local/Cellar/eixx/1.4/lib/libeixx.dylib | grep basic_otp_node_local::basic_otp_node_local
0x000000000000f900 ( 0x80) eixx::connect::basic_otp_node_local::basic_otp_node_local(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x000000000000f980 ( 0x75) eixx::connect::basic_otp_node_local::basic_otp_node_local(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x0000000000012062 ( 0x52) eixx::connect::basic_otp_node_local::basic_otp_node_local(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (.cold) [FUNC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x00000000000120b4 ( 0x51) eixx::connect::basic_otp_node_local::basic_otp_node_local(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (.cold) [FUNC, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
Linker error:
[100%] Built target
@(#)PROGRAM:ld PROJECT:ld64-609.8
BUILD 15:07:46 Dec 18 2020
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
/usr/local/Cellar/eixx/1.4/lib
/Users/heri/.asdf/installs/erlang/22.3.4.20/usr/lib
/usr/local/Cellar/openssl@1.1/1.1.1k/lib
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib
Framework search paths:
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/
Undefined symbols for architecture x86_64:
"eixx::connect::basic_otp_node_local::basic_otp_node_local(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
eixx::connect::basic_otp_node<std::__1::allocator<char>, std::__1::recursive_mutex>::basic_otp_node(boost::asio::io_context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::allocator<char> const&, signed char) in matching_node.cpp.o
ld: symbol(s) not found for architecture x86_64
Looks like there is a symbol mismatch?
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&
Seems to be the New ABI: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
Strange. Maybe this is MacOS a specific bug? Not getting this error on Linux. Did you try defining _GLIBCXX_USE_CXX11_ABI in the project? Is this happening in both gcc and clang? I don't have a Mac, so never tried to build it on that OS.
PR #50 now supports Clang which fixes this.
When you address the comments in my review of #50, I'll merge.
Fixed in PR #50 by supporting CLANG rather than defining _GLIBCXX_USE_CXX11_ABI
.
Build on macOs:
brew install cmake boost openssl@1.1
git clone https://github.com/saleyn/eixx.git
cd eixx
rm -f .cmake-args.$(hostname)
echo "ENV:BOOST_ROOT=$(brew --prefix boost)" >> .cmake-args.$(hostname)
echo "ENV:OPENSSL_ROOT_DIR=$(brew --prefix openssl)" >> .cmake-args.$(hostname)
echo "DIR:INSTALL=/usr/local/Cellar/@PROJECT@/@VERSION@" >> .cmake-args.$(hostname)
echo "EIXX_MARSHAL_ONLY=OFF" >> .cmake-args.$(hostname)
make distclean
make bootstrap build=Release toolchain=clang
make
Error while linking
basic_otp_node_local
:CMakefile:
Shouldn't these lines include the
basic_otp_node_local
into the shared library? https://github.com/saleyn/eixx/blob/5c0baa3b820b07fca3a5880d972445aee38b46c1/src/CMakeLists.txt#L8-L16