pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[INTERFACES] <string> in pgconnection.h (?)
2+ messages / 2 participants
[nested] [flat]

* [INTERFACES] <string> in pgconnection.h (?)
@ 1999-12-15 18:45  Richard <blackw@sfu.ca>
  0 siblings, 1 reply; 2+ messages in thread

From: Richard @ 1999-12-15 18:45 UTC (permalink / raw)
  To: pgsql-interfaces

I'm putting together my first C++ pgsql client program and have run into
a snag.  I #include <pgdatabase.h>, but when I compile, I get a message
saying

   /usr/include/pgsql/libpq++/pgconnection.h:24: string: No such file or
directory

Looking in pgconnection.h, I see

   #include <string>

(Call me old-fashioned, but I thought us C hacks had agreed to use ".h"
when naming our include files.)  Later on in the file I see the
declaration

   string IntToString(int);

Now, I assume that "string" is a class.  But where would I find the
header file "string"?

Thanks in advance for clarifying what is clearly !obvious to me.

Cheers,
Richard Blackwell



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] <string> in pgconnection.h (?)
@ 1999-12-15 21:09  Mike Mascari <mascarm@mascari.com>
  parent: Richard <blackw@sfu.ca>
  0 siblings, 0 replies; 2+ messages in thread

From: Mike Mascari @ 1999-12-15 21:09 UTC (permalink / raw)
  To: blackw@sfu.ca; +Cc: pgsql-interfaces

Richard wrote:

> I'm putting together my first C++ pgsql client program and have run into
> a snag.  I #include <pgdatabase.h>, but when I compile, I get a message
> saying
>
>    /usr/include/pgsql/libpq++/pgconnection.h:24: string: No such file or
> directory
>
> Looking in pgconnection.h, I see
>
>    #include <string>
>
> (Call me old-fashioned, but I thought us C hacks had agreed to use ".h"
> when naming our include files.)  Later on in the file I see the
> declaration
>
>    string IntToString(int);
>
> Now, I assume that "string" is a class.  But where would I find the
> header file "string"?
>
> Thanks in advance for clarifying what is clearly !obvious to me.
>
> Cheers,
> Richard Blackwell
>
>

The string class should have come with the standard C++ libraries installed
with your C++ compiler. For instance, on my RedHat 5.2 machine, I have:

$ cat /usr/include/g++/string

// Main header for the -*- C++ -*- string classes.

#ifndef __STRING__
#define __STRING__

#include <std/bastring.h>

extern "C++" {
typedef basic_string <char> string;
// typedef basic_string <wchar_t> wstring;
} // extern "C++"

#endif






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-12-15 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-12-15 18:45 [INTERFACES] <string> in pgconnection.h (?) Richard <blackw@sfu.ca>
1999-12-15 21:09 ` Mike Mascari <mascarm@mascari.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox