Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2008 01:25:06 -0500
From:      Paul Procacci <pprocacci@datapipe.com>
To:        EdwardKing <zhangsc@neusoft.com>
Cc:        FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: How to compile a c file into out file?
Message-ID:  <48882042.6060503@datapipe.com>
In-Reply-To: <00c001c8ed54$aa061420$3f83a8c0@neusofteaf5839>
References:  <00c001c8ed54$aa061420$3f83a8c0@neusofteaf5839>

next in thread | previous in thread | raw e-mail | index | archive | help
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?
>
>
> ----------------------------------------------------------------------------------------------
> Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Group Ltd., its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. 
> -----------------------------------------------------------------------------------------------
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>   

use the -o flag to specify a filename of your liking.

gcc -o somefile somefile.c somefile.o anotherfile.o ... ... ...

~Paul




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