Re: C++ STL linking error
Re: C++ STL linking error
- Subject: Re: C++ STL linking error
- From: Jeffrey Walton <email@hidden>
- Date: Sun, 03 Mar 2013 18:47:01 -0500
On Sun, Mar 3, 2013 at 6:41 PM, Todd Heberlein <email@hidden> wrote:
> I'm having a brain fart here. I hope someone can point out an obvious error.
>
> I have my own C++ library. When I link against it in a Cocoa app (with the appropriate files set to .mm), everything works fine.
>
> But when I start a new "Command Line Tool" project and try to link against the library, I get a lot of errors about missing STL symbols.
>
> Undefined symbols for architecture x86_64:
> "std::string::data() const", referenced from:
> netsq::Buffer::operator<<(std::string const&) in libNetSQ.a(NetsqBuffer.o)
> "std::string::length() const", referenced from:
> netsq::Buffer::operator<<(std::string const&) in libNetSQ.a(NetsqBuffer.o)
> "std::allocator<char>::std::allocator()", referenced from:
>
> What is strange, I can use the undefined symbol just fine in my code
>
> const char* p_data;
> std::string foo = "bar";
> p_data = foo.data();
>
> // netsq::Buffer myBuf;
>
> But when I uncomment the myBuf declaration, I get the linking error above (along with a bunch of other missing STL symbols).
>
> Any idea where I am screwing up?
http://marshall.calepin.co/c-and-xcode-46.html? (Thanks to Anton
Korobeynikov on another list for pointing out Marshall Clow's blog).
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden