Mail Archives: djgpp/1997/01/14/19:09:54
Gautam N. Lad wrote:
>
> Hi,
> When I compile my C++ program and link it to the graphics library,
> instead of the executable file having the same name as the source
> file, it's A.EXE and so is the .OUT file (A.OUT).
>
> The program works fine, except it keeps doing this. I think it also
> happened when I tried to compile a single .C program.
>
> I am compiling like this in C:
>
> gcc prog.c
>
> I am compiling like this in C++
> (Note window.cpp contains classes I created):
>
> gxx tb.cpp window.cpp /djgpp/contrib/grx20/lib/LIBGRX20.A
In common with other UNIX C compilers, gcc does not attempt to
guess what you want to call your program. If you do not provide
a name it defaults to a.out every time. The latest release of
djgpp turns this into a.exe so that DOS can recognise it as an
executable. If you want to call the program tb.exe, for instance,
you must use the -o option like so:
gxx -o tb.exe tb.cpp window.cpp /djgpp/contrib/grx20/lib/LIBGRX20.A
--
Ian Miller, Dorset, UK
DJGPP 2.01, Win95 DOS box (LFN undefined, FNCASE=y)
- Raw text -