From: Ian Miller Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP compiles wrong .EXE filename Date: Tue, 14 Jan 1997 10:37:47 +0000 Organization: DRA Lines: 30 Message-ID: <32DB61FB.41C67EA6@dra.hmg.gb> References: <5auogm$7hn AT news DOT interlog DOT com> NNTP-Posting-Host: 146.80.115.106 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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)