This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: error: 'string' undeclared (first use in this function)
- From: Ian Lance Taylor <iant at google dot com>
- To: "vinod" <vinod dot nanjaiah at gmail dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 14 Oct 2009 06:30:01 -0700
- Subject: Re: error: 'string' undeclared (first use in this function)
- References: <4ad560c8.86c3f10a.24d1.3a9d@mx.google.com> <94cf76f0910140117g756cc68fgce88159b02f2b251@mail.gmail.com> <4ad59a81.1ac1f10a.186f.ffff82ca@mx.google.com> <94cf76f0910140341w3a52a529h35518509f128bfe0@mail.gmail.com> <4ad5bd86.0d84100a.1425.ffffc3d3@mx.google.com>
"vinod" <vinod.nanjaiah@gmail.com> writes:
> Hi all ~
> I have #include <string.h> , but why am I still can't declare string ?
>
>
> When I compile my code ,show the error msg as follows :
> root@acer:~/probeServer# gcc probec.c -o probec -lm -lpthread
> probec.c:1:18: error: string: No such file or directory
<string> is not found. <string> is a C++ header. If you want C++,
compile with g++, not gcc.
Ian