From owner-freebsd-questions@FreeBSD.ORG Thu Jul 24 06:46:31 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50A41106566C for ; Thu, 24 Jul 2008 06:46:31 +0000 (UTC) (envelope-from carpetsmoker@rwxrwxrwx.net) Received: from mail.rwxrwxrwx.net (rwxrwxrwx.net [82.93.23.199]) by mx1.freebsd.org (Postfix) with ESMTP id D9F7D8FC15 for ; Thu, 24 Jul 2008 06:46:30 +0000 (UTC) (envelope-from carpetsmoker@rwxrwxrwx.net) Received: from localhost (localhost [127.0.0.1]) by mail.rwxrwxrwx.net (Postfix) with ESMTP id 641D16D43D; Thu, 24 Jul 2008 08:30:39 +0200 (CEST) Received: from mail.rwxrwxrwx.net ([127.0.0.1]) by localhost (mail.rwxrwxrwx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NrABVAsK0RtB; Thu, 24 Jul 2008 08:30:36 +0200 (CEST) Received: from rwxrwxrwx.net (phong [192.168.100.13]) by mail.rwxrwxrwx.net (Postfix) with ESMTPSA id 4FA0D6D409; Thu, 24 Jul 2008 08:30:36 +0200 (CEST) Date: Thu, 24 Jul 2008 08:27:24 +0200 From: Martin Tournoij To: freebsd-questions@freebsd.org Message-ID: <20080724062724.GA16332@rwxrwxrwx.net> Mail-Followup-To: freebsd-questions@freebsd.org, zhangsc@neusoft.com References: <00c001c8ed54$aa061420$3f83a8c0@neusofteaf5839> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <00c001c8ed54$aa061420$3f83a8c0@neusofteaf5839> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: zhangsc@neusoft.com Subject: Re: How to compile a c file into out file? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2008 06:46:31 -0000 On Thu, Jul 24, 2008 at 02:15:25PM +0800, EdwardKing wrote: > I compile a c file,like follows: > $gcc other1.obj other2.obj myfile.c > > Then it create a a.out file.my question is how to create a file named myfile.out instead of name a.out? Use the -o parameter, ie: % cc -o file file.c -- Martin Tournoij carpetsmoker@rwxrwxrwx.net http://www.daemonforums.org QOTD: Captain Penny's Law: You can fool all of the people some of the time, and some of the people all of the time, but you Can't Fool Mom.