• 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
Compiler error when handling C++ std::string class variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiler error when handling C++ std::string class variable


  • Subject: Compiler error when handling C++ std::string class variable
  • From: David Lobron <email@hidden>
  • Date: Wed, 11 Jun 2008 15:55:56 -0400

Hi All-

I'm compiling a project in XCode with gcc-4.0.1 that has a mixture of C++ and Objective-C++ files, with .cc and .mm extensions, respectively. I added a build rule telling the compiler to treat files matching "*.cc" as C++. When I compile, I get the following error:

Time.h:47: error: 'string' in namespace 'std' does not name a type

The code in question looks like this:

static std::string local( const time_t& iTime );

This compiles without a problem on Linux - only XCode throws the error. I suspect it might be happening because I'm not supplying a link command, e.g., to a libstdc++ dynamic library. However, I'm not sure what library to link with, or if library paths are even the problem. If anyone has seen this kind of error before, please let me know! I've never had a project with C++ in it, only Objective-C, so I'm a newbie here.

Thanks,

David
_______________________________________________
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: Compiler error when handling C++ std::string class variable
      • From: Dave Carrigan <email@hidden>
  • Prev by Date: Re: Link to zlib
  • Next by Date: Re: Link to zlib
  • Previous by thread: Re: Xcode next version feature request
  • Next by thread: Re: Compiler error when handling C++ std::string class variable
  • Index(es):
    • Date
    • Thread