This is the test code.
#include <string>
int main(int argc, char const *argv[]) {
std::string a = "hello";
std::string b = "world";
return 0;
}
I compile it by the command:
clang++ test.cpp -g
Then I try to debug it:
lldb a.out
I add break at 4th line, after the a = "hello"
runs. I try to print the a
by p a
, it show me the following error:
error: incomplete type 'string' (aka 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >') where a complete type is requ
ired
note: forward declaration of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
error: 1 errors parsing expression
I can't figure out.
Though when I try to compile by g++, it's OK.