Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2008 08:27:24 +0200
From:      Martin Tournoij <carpetsmoker@rwxrwxrwx.net>
To:        freebsd-questions@freebsd.org
Cc:        zhangsc@neusoft.com
Subject:   Re: How to compile a c file into out file?
Message-ID:  <20080724062724.GA16332@rwxrwxrwx.net>
In-Reply-To: <00c001c8ed54$aa061420$3f83a8c0@neusofteaf5839>
References:  <00c001c8ed54$aa061420$3f83a8c0@neusofteaf5839>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080724062724.GA16332>