Reputation: 79
ninja
(version: 1.9.0) output:
mergetree_test.cpp:(.text+0x19f): undefined reference to `DB::executeQuery(std::string const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)'
nm -A mergetree_test.o | grep executeQuery | c++filt
output:
mergetree_test.o: U DB::executeQuery(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)
But I got output from linked libaries where executeQuery
defined using the same method.
libdbms.a:executeQuery.cpp.o:0000000000008750 T DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)
What does __1
mean ? how can I solve the problem ?
Upvotes: 3
Views: 2303
Reputation: 16670
I suspect that you're attempting to combine libraries that were compiled using libc++ and libstdc++.
libc++ puts (almost) all of it's symbols into std::_1::
, while libstdc++ puts it's symbols in std::
Upvotes: 5
Reputation: 571
You asked two questions so I'm gonna answer the main one(What is __1
?):
__1
is an inline namespace located in std
:
namespace std
{
inline namespace __1
{
// string, ...
}
}
The inline
means that one does not have to specify that the structure/function/variable is located in that namespace, so that one can simply use std::string
instead of std::__1::string
.
As for why you are getting errors: We can't know without you providing us with some code.
Upvotes: 0