Date: Mon, 5 Apr 93 00:11:37 CST From: Shawn_McHorse AT fcircus DOT sat DOT tx DOT us (Shawn McHorse) Subject: Re: help: gcc says 'unknown file type 0x2a2f (025057)' To: beale AT jumpjibe DOT stanford DOT edu Cc: djgpp AT sun DOT soe DOT clarkson DOT edu In <9304032039 DOT AA15665 AT jumpjibe DOT Stanford DOT EDU>, beale AT jumpjibe DOT stanford DOT edu (John Beale) writes: > Sorry if this is a FAQ but the docs don't seem to mention it... I am quite sure the docs mention the proper command line usage of gcc... or you can just browse through one of the makefiles...:-) > [He installed DJGPP.] > > Now to try out a sample program. Here's what I tried in detail: > > C:\>cd gcc\samples\compress > > c:\GCC\SAMPLES\COMPRESS>gcc -O compress.c > /gcc/bin/bcc.exe Copyright (C) 1991 DJ Delorie > Can't open file (-O) The only thing the parameter -O tells gcc is that you want the compiler to optimize when compiling. Although this is quite nice (:-), it is not what you want. The command "gcc -O -c compress.c" would produce the file compress.o, which could then be linked either by itself or with other .o files to produce a final executable for your program. However, since compress.c is a standalone program, "gcc -o compress.o" will produce the file "compress" with no extension. In order to run this, you can type "go32 compress", and assuming that go32.exe is somewhere in your path compress will be run. If you wish to convert this to a standard DOS .EXE file, running "aout2exe compress" will produce compress.exe...which can then be run like any other .EXE file. Also...to avoid the intermediary "compress.o" file, you could simply run "gcc -O -o compress.c" to produce the "compress." file. > C:\GCC\SAMPLES\COMPRESSgcc compress.c > /gcc/bin/gcc.exe Copyright (C) 1991 DJ Delorie > Unknown file type 0x2a2f (025057) This is not what you want either, as you should now well know...:-) > (This is typed in from a printout, it's "C:\GCC..." and "/gcc/bin/gcc.exe..." > but you get the idea. The errors as shown were what appeared on screen.) > > Obviously gcc is not getting the command-line parameters passed to it > correctly, but why? Thanks for any assistance. Oh...gcc was getting your command-line parameters just fine. They just weren't the correct ones. Your welcome and I'll chat with you later... > > John Beale (beale AT jumpjibe DOT stanford DOT edu) > -- Shawn_McHorse AT fcircus DOT sat DOT tx DOT us Only YOU can prevent .sig abuse