Re: Compiler error when handling C++ std::string class variable
Re: Compiler error when handling C++ std::string class variable
- Subject: Re: Compiler error when handling C++ std::string class variable
- From: David Lobron <email@hidden>
- Date: Thu, 12 Jun 2008 14:24:31 -0400
I checked the window, but I did not see any /usr/* directories
mentioned. I will keep digging....
--David
On Jun 12, 2008, at 12:52 PM, Arvan Pritchard wrote:
It's the presence of /usr/include/sys that causes the problem, so
adding it won't help. I was wondering whether it was already there...
If you click the 3rd button at the bottom of the Xcode Build
Results window to show the build transcript you can see the actual
command used, look for -I/usr/include/sys in there (or for all the -
I entries).
Arvan
On 12/06/2008 17:03, David Lobron wrote:
Hey Arvan-
I tried adding /usr/include/sys to my search path, but it did not
seem to make a difference- I still get both sets of errors. I'm
actually not sure what the default header paths are: this is the
only one I'm overriding.
Weird!
--David
On Jun 12, 2008, at 11:33 AM, Arvan Pritchard wrote:
Hi David,
I recently hit these errors from #include<string> when I added /
usr/include/sys to my header search paths (rdar://5997145).
What are your header search paths?
Arvan
On 12/06/2008 16:01, David Lobron wrote:
I added an explicit include statement (#include <string>). Now,
I get this error:
Time.h:26:18: error: string: No such file or directory
I also get a new set of errors before this one occurs. These
are coming from the file "ctime" in the C++ library:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ctime:68:
error: '::tm' has not been declared
The code it's referring to looks like this:
namespace std
{
using ::clock_t;
using ::time_t;
using ::tm;
I get this in the pre-compiling headers stage - there are lots
of others, also for ::namespaces that are missing. It's coming
from a file that is part of the SDK.
It seems like these errors may be related, but I'm not sure how-
any help is appreciated.
Thanks,
David
On Jun 11, 2008, at 4:14 PM, Dave Carrigan wrote:
On Jun 11, 2008, at 12:55 PM, David Lobron wrote:
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.
It's a compiler error, which means you haven't gotten to the
link phase, so it has nothing to do with your libraries. Most
likely you don't have a "#include <string>" in your file. If it
compiles on Linux, that just means that something in the Linux
headers is including <string> for you.
--
Dave Carrigan
email@hidden
Seattle, WA, USA
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden This email sent to
email@hidden
--
Arvan Pritchard
Informatix Software International Limited
Tel +44 (0)1223 246777 Fax +44 (0)1223 246778
Registered office: 509 Coldhams Lane, Cambridge, CB1 3JS, United
Kingdom
Company Registration in England & Wales 3319498, VAT number GB
688 5110 10
www.informatix.co.uk
This e-mail and its attachments may be confidential and are
intended for the addressee(s) only. If you are not the stated
recipient you must not disclose, copy or distribute them; please
notify us of the error immediately.
--
Arvan Pritchard
Informatix Software International Limited
Tel +44 (0)1223 246777 Fax +44 (0)1223 246778
Registered office: 509 Coldhams Lane, Cambridge, CB1 3JS, United
Kingdom
Company Registration in England & Wales 3319498, VAT number GB 688
5110 10
www.informatix.co.uk
This e-mail and its attachments may be confidential and are
intended for the addressee(s) only. If you are not the stated
recipient you must not disclose, copy or distribute them; please
notify us of the error immediately.
_______________________________________________
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