LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-16-2003, 10:30 AM   #1
fhameed
Member
 
Registered: Oct 2003
Location: Pakistan
Posts: 59

Rep: Reputation: 15
how do i run my c compiler


Hello

I'm a newbie 2 linux and have managed 2 install and put linux on network/internet.

My Question:How can i know whether i have a C compiler installed or not.If it's installed what are the commands to run the complier,compile the code and execute the program(everything).Like in windows i can do everything with a click.

Thank you.

Fhameed
 
Old 11-16-2003, 10:53 AM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
# Guides to software management
LNAG - How do I install a program I downloaded from the Internet?
Rute Guide's software explanation
You might want to check out CheckInstall to manage source code installations/uninstallation

Here are some handy commands I have collected

Handy bash commands for finding out stuff in Linux:
# Find CPU specifications
cat /proc/cpuinfo

# Find running kernel version
uname -r

# What compiler version do I have installed
gcc -v
gcc --version

# What is the running kernel and compiler installed
cat /proc/version

# Find X server version
X -showconfig

# What pci cards are installed and what irq/port is used
cat /proc/pci

# Memory and swap information
cat /proc/meminfo
free
An article: Tips for Optimizing Linux Memory

# How are the hard drives partitioned
fdisk -l

# How much free/used drive space
df -h

# Show disk usage by current directory and all subdirectories
du | less

# What takes up so much space on your box
# Run from the directory in question and the largest chunk shows up last
find $1 -type d | xargs du -sm | sort -g

# What is the distribution
cat /etc/.product
cat /etc/.issue
cat /etc/issue
cat /etc/issue.net
sysinfo

# For finding or locating files
find
locate
which
whereis

# Use dmesg to view the kernel ring buffer (error messages)
dmesg | less

# Watch error messages as they happen (sysklog needed)
as root, tail -f /var/log/messages (shows last 10 lines, use a number in front of f for more lines)

# What processes are running
ps -A

# Find a process by name
ps -ef | grep -i <plain text>
For example, XCDroast
ps -ef xcdroast

# See current environment list, or pipe to file
env | more
env > environmentvariablelist.txt

# Show current userid and assigned groups
id

# See all command aliases for the current user
alias

# See rpms installed on current system
rpmquery --all | more
rpmquery --all > <filename>
rpmquery --all | grep -i <plaintext>

Autospec for tarballs
RPM tools

# What directory am I using
pwd

# Get ls colors in less
ls --color=always | less -R

Look at man <command> or info <command> for the flags I used and for other options you can use for bash commands.
 
Old 11-16-2003, 11:06 AM   #3
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Well.. save your C source code in an ordinary text file with a .c extension ie

sourcefile.c

then - on the command line cd into the directory which the source file is in then:

gcc sourcefile.c -o executable_name

and to run it try

executable_name

or

./executable_name

or move it into your PATH (depending on circumstances)

(you can always

chmod 755 path_to_sourcefile.c

etc etc to have more control on permissions)

Last edited by Skyline; 11-16-2003 at 11:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
error: "c compiler cannot create executables" when trying to run ./configure fedoraemu Linux - Software 2 04-24-2007 07:43 PM
Will C++ Application run in computer without gcc c-compiler srivembu Linux - General 4 09-03-2005 10:20 AM
C compiler cannot run C compiled programs petero Programming 8 05-27-2005 11:35 AM
Compiler conundrum: Which came first, a compiler, or it's source code? fr0zen Programming 21 01-29-2004 04:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration