This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Trying to compile a simple C++ program


Hello.

I typed a simple program into a file 'a.cpp':

#include <iostream.h>

main()
{
 cout << "Hi!";
}

and then tried to compile it:
$ gcc -o a.exe a.cpp

All I got is:

/c/WINDOWS/TEMP/ccnLFh81.o(.text+0x18):a.cpp: undefined reference to `cout'
/c/WINDOWS/TEMP/ccnLFh81.o(.text+0x1d):a.cpp: undefined reference to
`ostream::operator<<(char const *)'
collect2: ld returned 1 exit status

What's wrong? It seems that maybe something is wrong with the header files
(iostream.h maybe) but what should I do to make gcc compile this program?
My cygwin version is 1.1.8-2 and gcc version is 2.95.2-7

Anton.



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]