Mail Archives: djgpp/1999/09/29/12:33:53
On Tue, 28 Sep 1999, Rodeo Red wrote:
> I compiled in RHIDE and it said there were no errors, but it made a
> program called hello.o when I thought it would make hello.exe. What
> is going on here ?
That's because you compiled instead of compile-and-link. The former
produces an object file, the latter produces an executable program.
> C:\WINDOWS>gcc hello.cpp -o hello.exe -lm
> c:/djgpp/tmp\cccimbbe(.text+0x19):hello.cpp: undefined reference to `cout'
> c:/djgpp/tmp\cccimbbe(.text+0x1e):hello.cpp: undefined reference to `ostream::operator<<(char const *)'
>
> C:\WINDOWS>
> What in the world does this mean ?
It means some of the library functions called by your programs wasn't
found by the linker.
> I don't see any reference to this in the faq
I think section 8.7 explains this: you need to use gxx or gpp insteadd
of gcc to link C++ programs.
> Again, the reason it says C:\WINDOWS> is that I can't controll the
> prompt very well. If I write prompt it gives me C:\> but I wish I
> could make it go C:\myprograms\hello>
The prompt shows the current working directory. To change to another
directory, use the CD command, like this:
cd c:\myprograms
If the directory C:\myprograms doesn't exist, you will need to create
it first:
mkdir c:\myprograms
- Raw text -