From owner-freebsd-questions Fri Oct 17 09:07:43 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA19340 for questions-outgoing; Fri, 17 Oct 1997 09:07:43 -0700 (PDT) (envelope-from owner-freebsd-questions) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id JAA19332 for ; Fri, 17 Oct 1997 09:07:38 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.5/8.8.5) with SMTP id JAA03419; Fri, 17 Oct 1997 09:07:32 -0700 (PDT) Date: Fri, 17 Oct 1997 09:07:32 -0700 (PDT) From: Doug White Reply-To: Doug White To: Lukas Ruf cc: questions@FreeBSD.ORG Subject: Re: a.out <-> GNU CC In-Reply-To: <34472f6e.11976311@1.1.1.17> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Fri, 17 Oct 1997, Lukas Ruf wrote: > >> Is there a possibility to link OBJs to a.out using ld / gcc ?? > > > >Do you mean DOS .OBJ's? No, the object format is completely different. > > I do not mean DOS .OBJs by writing OBJ. I use these three characaters > as a short form of Object Format. I see. The extension that UNIX c compilers boot out for object files is .o, and DOS compilers use .OBJ. Then the answer is: Well of course! A c compiler wouldn't be very useful if you couldn't generate binaries with it. :-) > >If you mean, can FreeBSD compile to a.out format from source, yes, we > >haven't adopted ELF exclusively yet. > > I thank you a lot for this nice answer -- but how can I create a.out ? It's generated automatically by default, assuming you don't give the -c option to gcc. I don't think FreeBSD ships with the capability to generate ELF, although an elfkit is available to do so. I'll accept corrections on this from the -current crew if I'm off here. > Could you please give me the solution for gcc 2.7.x and ld ?? Say you have the file hello-world.c that you want to make into an executable. Simply execute: $ gcc hello-world.c This will generate an executable called ``a.out'' which you can then run by typing $ ./a.out at the prompt. If you want to specify the name of the target executable, you can use the -o option: $ gcc -o hello-world hello-world.c Now you get an executable called ``hello-world''. Does that help answer your questions? If you have any more, and you installed the info distribution, run `info gcc' to get the GCC manual. Also see `man gcc'. Doug White | University of Oregon Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant http://gladstone.uoregon.edu/~dwhite | Computer Science Major