At 02:42 AM 1/7/2005, you wrote: >Hi all: > I want to know how to compile a program in cygwin using gcc. > Here is my instance: > 1>I install cygwin in c:/cygwin > 2>I wrote a piece of code named test.c in E:/prog/test/test.c. > AND suppose the program just printf "hello". > > How can i compile and link my code using gcc ? Should i give >the absolute path of my program (E:/prog/test/test.c.) when using gcc? > And another problem is where the "hello " is printf? Is it in >the windows console or "cygwin console"(i don't know whether it is >appropriate name )? > Thank you for your patience.
These are actually more generally questions about how to use 'gcc', which you should be able to get from documentation about 'gcc'. I'd suggest <http://gcc.gnu.org/onlinedocs/>. Since these are really general 'gcc' questions, they are really off-topic. However, the question about where the output will occur may be a grey area. ;-) The "console" in Windows is generally the window in which you can type commands. The most well-known program of this kind is the "DOS box", called cmd.exe on NT-based platforms and command.com on 9x-based platforms. The Cygwin shells, bash, ash/sh, tcsh, zsh, etc run in a "DOS box". But Cygwin programs can run in a "DOS box" regardless of whether you're running a Cygwin shell. So the output of "printf" goes to, by default, the "DOS box" that you're running the program from. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 838 Washington Street (508) 893-9889 - FAX Holliston, MA 01746 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/