473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

executing c program using Cygwin

hi
can any one please let me know how to execute a c program using cygwin
Sep 24 '07 #1
1 1601
mattmao
121 100+
Hello.

I am a user of cygwin.

First, run the Cygwin, a window would be prompted, inside of which would be a command-line interface:

Use UNIX commands to move yourself to the right directory where your c codes reside:

>:pwd
>:your current location presented to you here
>: cd somedirectory
>: ls
>: . .. test.c

There you go, you are in the right postion

Now use the gcc compiler to generate executable file.
>: gcc test.c

If your code is fine, you would see nothing from the CLI, but you can check the result

>: ls
>: . .. test.c a.exe

Now the a.exe is the executable file generated by gcc compiler.

Run it:

>: ./a.exe






Note that if you installed Cygwin not properly, you might not have the gcc compiler in your cygwin environment. In this situation I suggest you reinstall cywgin and pay special attention to the time when you are asked to choose the applications. Make sure that the gcc is ticked. I am not quite sure if that is the default option.

And you can try using the cc compiler to run your code:

>: cc test.c
Sep 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: DvDmanDT | last post by:
Hello, I have an intresting problem: I want to let users upload sourcecode and then compile it using my cygwin gcc... But one thing at a time... I can't get that gcc to execute... ...
0
by: Joonas Paalasmaa | last post by:
Hi, When compiling Sketch's streamfilter C extension the errors below are raised during linking. What could cause the errors? (Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98) Here are...
1
by: Will Stuyvesant | last post by:
I never used the popen or popen2 libraries but it is my understanding that they can capture the output of console based programs. Is it also possible to send keystrokes to console base programs? ...
4
by: KB | last post by:
Hi, I want to write a Python script that controls and automates a Windows GUI computation program. My problem is that I do not know how to quit the Windows GUI program gracefully with a...
3
by: Abby | last post by:
I'm now using Cygwin as my compiler for C code. I use Dev-c++ as my editor. The reason why I chose Cygwin compiler instead of the compiler that came with Dev-C++ is that I believe it uses the same...
3
by: Pankaj | last post by:
I am facing a very basic problem as any new bie would face. I know perl and now i want to use python In perl, it is very simple , just "perl scriptname.pl" will execute the script. But i...
7
by: tshad | last post by:
I thought I understood how the SaveViewState is working and was trying to use this (as per some code I found) to detect refreshes. It seemed to be working but I found that the SaveViewState was...
1
by: ronaldgranados | last post by:
Hi, I developed an application that generates code to be dinamically execute with reflection. When I used reflection everything seems to work fine until I saw a handle and memory leak. ...
3
by: nick048 | last post by:
Hi to all, I have written a little Server program in C and I have compiled this with Cygwin without errors. This is my code: // Prototype void wordReceived(int sd,char *s); int main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.