[cfe-dev] Undefined reference to `std::basic_string<char>... error

Asudani, Mohit Mohit.Asudani at netapp.com
Thu Jan 20 21:18:00 PST 2011

Hi  Clang Developers,


I downloaded the latest revision (r123891) of LLVM via SVN and followed
the instructions at http://clang.llvm.org/get_started.html  to configure
and build. 


While building I received  following error:


Linking Debug+Asserts executable FileCheck

In function `char* std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_construct<char const*>(char const*, char
const*, std::allocator<char> const&, std::forward_iterator_tag)':

/c++/4.1.1/bits/basic_string.tcc:158: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
>::_Rep::_M_set_length_and_sharable(unsigned long)


Searching for error directed me to forum suggesting addition of -lstdc++

I tried to modify makefile but it didn't worked. What is the best way to
modify LDFLAGS for incorporating the specified option ? 



After looking logs for past revisions, one of them (r121379) yielded:


r121379 | mspencer | 2010-12-09 23:06:48 +0530 (Thu, 09 Dec 2010) | 1

Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with
error_code &ec. 

And fix clients.



I want to know if these observations are related in any way and if this
is known error and has been encountered before by users.




Mohit Asudani



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110121/31d4b69a/attachment.html>

More information about the cfe-dev mailing list