473,325 Members | 2,860 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,325 software developers and data experts.

Using C with RedHat Linux

i want to execute hello.c on red hat linux.i m having problem in compilation.where to save file hello.c and plz reply.i m waiting.
Oct 1 '07 #1
3 1421
sicarie
4,677 Expert Mod 4TB
i want to execute hello.c on red hat linux.i m having problem in compilation.where to save file hello.c and plz reply.i m waiting.
You can do that in any folder. I would make sure you have a C compiler installed. I believe RedHat comes with gcc, so at the command line, type:

gcc -v

If that comes up with a whole bunch of information (not errors), then you have gcc. Which means all you need to do is go to the folder where you have saved your hello.c and type:

gcc -o hello.out hello.c

The -o option will allow you to specify the output name - in this case hello.out. Otherwise, it will just be saved as a.out. Then you can run the program by typing

./hello.out

PS - I am moving this to the C++ Forum section from the Articles section. Please double check where you are before creating a thread next time. Thanks!
Oct 1 '07 #2
Here is a simple way :

cc hello.c
./a.out
hey ./a.out is the output file
Oct 1 '07 #3
sicarie
4,677 Expert Mod 4TB
Here is a simple way :

cc hello.c
./a.out
hey ./a.out is the output file
Once again, that is assuming that cc is installed.
Oct 1 '07 #4

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

Similar topics

2
by: Geiregat Jonas | last post by:
I'm running a linux system I would like to create a login system based upon the users and passwd of my linux box how could I do this ?
1
by: Michael A. Miller | last post by:
I start PostgreSQL in the services utility under Redhat 9.0 with no issues. PostgreSQL runs properly but as soon as I log out PostgreSQL shuts down. It seems that I always need to be logged in for...
3
by: hrishy | last post by:
Hi Does anybody have the steps to install db2v8.1 on redhat advanced server 3.0.THe db2 i have is form the linux starter kit available freely on developerworks for learning purpose. I tried...
3
by: Harold Pritchett | last post by:
Will FixPak 10 for db2 UDB work on Redhat Enterprise Linux V3? The IBM site says that FixPak 10 is only available for the 2.6 kernel. ...
10
by: Ramprasad A Padmanabhan | last post by:
Hello all, On my linux box ( redhat 7.2 ), I have been using char as a boolean data type. In order to save on the number of bytes as compared to using int or short int. typedef char boolean;...
7
by: tehn.yit.chin | last post by:
I am trying to experiment <algorithm>'s find to search for an item in a vector of struct. My bit of test code is shown below. #include <iostream> #include <vector> #include <algorithm>...
0
by: jgarber | last post by:
Hello, I just upgraded MySQLdb to the 1.2.0 version provided by Redhat Enterprise Linux ES4. At that point I began to get segfaults when importing twisted after MySQLdb, but not before. --...
11
by: juyi520 | last post by:
Hello, I am new in C in Programming, Where could I find the detail about struct FILE in RedHat Linux ? I have tried to check the stdio.h in /usr/include, but I could not find the
3
by: Chris Jones | last post by:
Hi, I've experimenting with using boost::pool_allocator with std::vector and gcc (4.1)., and I am having problems with segmentation violations. Below I give a simple example of one way I am...
4
by: Stephen Cattaneo | last post by:
Hello all, I am attempting to execute an automated test (written in Python) via cron. I have to check the HOSTNAME variable as part of the test, oddly under cron the HOSTNAME environment...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.