• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C++ STL linking error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: C++ STL linking error
      • From: Todd Heberlein <email@hidden>
    • Re: C++ STL linking error
      • From: Marshall Clow <email@hidden>
References: 
 >C++ STL linking error (From: Todd Heberlein <email@hidden>)

  • Prev by Date: C++ STL linking error
  • Next by Date: Re: C++ STL linking error
  • Previous by thread: C++ STL linking error
  • Next by thread: Re: C++ STL linking error
  • Index(es):
    • Date
    • Thread