Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbol when linking with LLD #167

Open
ViNi-Arco opened this issue Apr 14, 2024 · 3 comments
Open

Undefined symbol when linking with LLD #167

ViNi-Arco opened this issue Apr 14, 2024 · 3 comments

Comments

@ViNi-Arco
Copy link

Hi, I'm building with Clang/LLVM/LLD 17.0.6, both the latest release 58 and git master are giving this error:

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::append(char const*)
>>> referenced by INIReader.cpp
>>>               libINIReader.so.0.p/cpp_INIReader.cpp.o:(INIReader::ValueHandler(void*, char const*, char const*, char const*))
>>> referenced by INIReader.cpp
>>>               libINIReader.so.0.p/cpp_INIReader.cpp.o:(INIReader::ValueHandler(void*, char const*, char const*, char const*))

ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::append(char const*, unsigned long)
>>> referenced by INIReader.cpp
>>>               libINIReader.so.0.p/cpp_INIReader.cpp.o:(INIReader::MakeKey(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&))
@ViNi-Arco ViNi-Arco changed the title Undefined symbol error when linking the LLD Undefined symbol when linking with LLD Apr 14, 2024
@benhoyt
Copy link
Owner

benhoyt commented Apr 14, 2024

Ah, the beauty of C++ error messages ... I actually have no idea what this error means. Are you linking to the right C++ runtime libs?

@ViNi-Arco
Copy link
Author

ViNi-Arco commented Apr 15, 2024

Are you linking to the right C++ runtime libs?

Yes, I'm passing libc++ to meson -D buildtype=plain -Dcpp_args='-O2 -stdlib=libc++', removing it allows me to build inih, which makes it use gcc libstdc++, is INIReader.cpp incompatible with LLVM libc++?

@benhoyt
Copy link
Owner

benhoyt commented Apr 18, 2024

Yeah, I guess so! I'm not sure, though -- I'll leave this open in case you get a chance to dig further or somebody else has an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants