C++ problems with RC1
| От | teg@redhat.com (Trond Eivind Glomsrød) |
|---|---|
| Тема | C++ problems with RC1 |
| Дата | |
| Msg-id | xuylmept3lm.fsf@halden.devel.redhat.com обсуждение исходный текст |
| Ответ на | RC1 finally wrapped ... ("Marc G. Fournier" <scrappy@hub.org>) |
| Ответы |
Re: C++ problems with RC1
|
| Список | pgsql-hackers |
The autoconf test for C++ doesn't work with standard-enforcing
compilers....
[teg@halden teg]$ cat foo.C
#include <string>
int main(int argc, char **argv){string foo="xyzzy";return 0;
}
[teg@halden teg]$ c++ foo.C -o foo
foo.C: In function `int main(int, char**)':
foo.C:4: `string' undeclared (first use this function)
foo.C:4: (Each undeclared identifier is reported only once for each function it appears in.)
foo.C:4: parse error before `=' token
[teg@halden teg]$
The standard mandates that string is accessed in one of the following
ways:
[teg@halden teg]$ cat foo2.C
#include <string>
using namespace std;
int main(int argc, char **argv){string foo="xyzzy";return 0;
}
[teg@halden teg]$ cat foo3.C
#include <string>
int main(int argc, char **argv){std::string foo="xyzzy";return 0;
}
[teg@halden teg]$
Some compilers accept the old way (and namespaces have been available
for quite some time now), others (like upcoming gcc 3.1) don't.
--
Trond Eivind Glomsrød
Red Hat, Inc.
В списке pgsql-hackers по дате отправления: