Mail Archives: djgpp/1999/09/29/12:47:20
Rodeo Red <rodeored AT netstep DOT net> wrote in message
news:4444922EAD9F4DF3.F0655FD613956B47.41732>
> Well I really thought I had- I have that file in every concievable directory
by now. But after I got your message i saved
> it again to a new directory and that seems to have worked. Thanks for the
help.
Here is an example (saying you are in C:\ and your source file is in C:\SOURCE):
C:\> cd source
C:\SOURCE>gcc test.c -o test.exe
That will create test.exe from the test.c source file. You need to be in the
directory your program is in to compile it. If you want to use rhide, you need
to go to the directory your source is in and type rhide at the DOS prompt. GCC
is a command line driven compiler.
> 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 ?
> The faq mentions something about "no exe " but its talking about novel
programs which I do not have, so it doesn't seem to
> apply.
Compiling and Linking are two seperate stages of the compilation process.
Compiling takes the source files and construct from them "object files". A
project can have several object files. The next stage is called linking. Linking
consists of taking your now-created object files, linking them together (thus
the name), and creating an executable file.
Please read the README.1ST file that comes with your DJGPP distribution. It
contains important information that you need to learn.
> Hello.o appears in the windows directory, I suppose because I started rhide
from the window prompt. I can't seem to make
> C:\myprograms\hello>
>
> I tried compliling without rhide and got :
>
> 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::o
> erator<<(char const *)'
>
> C:\WINDOWS>
> What in the world does this mean ? I don't see any reference to this in the
faq
This is because are trying to compile a C++ program without linking the C++
libraries.
> 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>
>
> How do I do that ?
cd \myprograms\hello
It's a shame that the world of Windows has completely obsoleted the need for the
computer user to learn at least some basic DOS commands. Maybe you should get a
book on how to use DOS (note, DOS, not Windows).
--
Johan Venter
ICQ 3643877 - jventer AT writeme DOT com
The TPU DJGPP Interest Group - http://surf.to/djgppig
The RSXNTDJ 1.5 HOWTO - http://surf.to/rsxntdj
- Raw text -