[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

gcc linker-error's



I have tried to compile the most simple C++ program whith the gcc 
compiler (2.7.2). I do not have the exact source code, but it's 
something like:

#include <iostream.h>

void main() {
  int i = 9;
  
  cout << " write a some text.\n";

}

saved in a file called test.cc. 
Trying the following:

   gcc -c test.cc (works fine indicating the the compiler accepts 
                   the input)
   gcc -L test test.o (assuming test.o made as above)

or simply

   gcc -o test test.cc
   
both give the following (linker) errors:

/tmp/cca001121.o: In function `main':
/tmp/cca001121.o(.text+0x13): undefined reference to `cout'
/tmp/cca001121.o(.text+0x13): undefined reference to 
`ostream:operator<<(char const *)'

does anyone have a solution to this problem. Besides gcc and binutils 
I have installed: libc5-dev-5.2.18-9.deb, libg++27-2.7.1-2.deb. Also I 
have tried with: libobjects-0.1.19-1.deb but it didn't help.

thanks in advance, Niels Bo Johansen

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: