Help needed compiling using gcc
Alexandre Oliva
aoliva@cygnus.com
Wed Apr 19 12:42:00 GMT 2000
On Apr 19, 2000, Sahar Isaac <dominic@clara.net> wrote:
> bash$ gcc Test.cc
> /tmp/ccx26951.o: In function `main':
> /tmp/ccx26951.o(.text+0xf): undefined reference to `cout'
> /tmp/ccx26951.o(.text+0x14): undefined reference to
> `ostream::operator<<(char const *)'
Use `g++' to get the C++ Standard Library linked in, or link it in
explicitly with `-lstdc++'. You may also need `-lm', depending on the
symbols you pick from libstdc++.
> bash$ gcc Test.c
> hello.c:5: iostream.h: No such file or directory
Now you're compiling C, and the directories with C++ header files are
not searched. Again, if you use g++, the language will be set to C++,
despite the `.c' extension.
--
Alexandre Oliva Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me
More information about the Gcc-help
mailing list