• 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
C++ STL linking error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ STL linking error


  • Subject: C++ STL linking error
  • From: Todd Heberlein <email@hidden>
  • Date: Sun, 03 Mar 2013 15:41:07 -0800

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?

Thanks,

Todd


 _______________________________________________
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: Jean Suisse <email@hidden>
    • Re: C++ STL linking error
      • From: Jeffrey Walton <email@hidden>
  • Next by Date: Re: C++ STL linking error
  • Next by thread: Re: C++ STL linking error
  • Index(es):
    • Date
    • Thread