`size_t' undeclared in namespace `std'
Albert Cervera Areny
Wed May 14 23:26:00 GMT 2003
-----BEGIN PGP SIGNED MESSAGE-----
I have developed an small proxy (proxirc.sourceforge.net) but I was developing
it using gcc 2.9x
Now I've tried compiling it with 3.x and I can't. At first, somebody told me I
had to add the 'using namespace std' or 'using std::string' to solve my
problem and It was fixed, but now I get this one:
g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
- -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"proxirc\"
- -DVERSION=\"0.5\" -I. -I. -I libmsn -I /usr/include/g++-3 -O3 -g -O2 -c -o
proxirc-proxirc.o `test -f 'proxirc.cc' || echo './'`proxirc.cc
In file included from /usr/include/c++/3.2/backward/new.h:33,
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider
using one of the 32 headers found in section 126.96.36.199 of the C++ standard.
Examples include substituting the <X> header for the <X.h> header for C++
includes, or <sstream> instead of the deprecated header <strstream.h>. To
disable this warning use -Wno-deprecated.
In file included from /usr/include/c++/3.2/backward/new.h:34,
/usr/include/c++/3.2/new:79: `size_t' undeclared in namespace `std'
/usr/include/c++/3.2/new:79: declaration of `operator new' as non-function
/usr/include/c++/3.2/new:79: invalid declarator
I'm sorry if the answer is very simple (which I suspect it is) but I have not
been able to find it in google nor in the archives.. Could somebody point me
the possible causes or any document explaining the changes between 2.9x and
As a test I tried to compile this and it worked without problems. (Just to see
if I needed <string> or <string.h>)
using namespace std;
Thanks in advance!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Gcc-bugs