LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-06-2009, 09:13 AM   #1
ryellamr
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Problem when running simple c program


#include<stdio.h>
int main()
{
printf( "I am alive! Beware.\n" );
}

Did "gcc -c smpl.c " -- compiled successfully

then did "gcc -o smpl.o " -- returning gcc: no input files

even tried "gcc -o smpl " -- returning gcc: no input files

Can any one pls tell me how to make this run successfully..
 
Old 06-06-2009, 09:20 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I think what you want is
gcc smpl.c -o smpl
 
Old 06-06-2009, 11:57 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
  • And welcome to Linux Questions.
 
Old 06-06-2009, 02:38 PM   #4
noctilucent
Member
 
Registered: Jun 2009
Distribution: slackware
Posts: 123

Rep: Reputation: 34
Beware indeed.
 
  


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
unrecognized class file version : when running simple Java program yuubouna Linux - Newbie 1 11-27-2008 11:25 PM
Simple script - check if program is running KrzysieQ Linux - Server 3 02-17-2008 07:48 AM
Problem - A simple C program using Structures manishsingh4u Programming 6 05-15-2006 03:55 AM
simple C program problem speel Programming 14 02-27-2005 05:08 PM
simple C program problem mined Programming 2 05-08-2004 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:55 AM.

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