LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-17-2008, 10:40 PM   #1
saritha
Member
 
Registered: May 2007
Posts: 117

Rep: Reputation: 15
-bash: ./a.out: No such file or directory


i am using suse linux,when i compiled a program it worked and created output file ,but when i am running that output file it giving this error
mallika:~ # gcc s1.c

mallika:~ # ./a.out
-bash: ./a.out: No such file or directory

where is the problem is it due to gcc not installed properly,if so can u tell me what to do to work gcc
 
Old 02-17-2008, 11:32 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
You should have got some error msgs if there was a problem... did you?
Can you do a
ls -l
to show us what you've got?
Maybe the s1.c source as well?
 
Old 02-18-2008, 04:57 AM   #3
saritha
Member
 
Registered: May 2007
Posts: 117

Original Poster
Rep: Reputation: 15
thanks for ur reply
i had just compiled simple program
s1.c
#include <stdio.h>
int main()
{
printf("hello world");
}

i had compiled as
mallika:~ # gcc s1.c
mallika:~ # ./a.out
-bash: ./a.out: No such file or directory

i had given
mallika:~ # ls -l ./a.out
-rwxr-xr-x 1 root root 6506 Feb 18 16:25 ./a.out


so can u tell me where is the problem
 
Old 02-18-2008, 06:23 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
If you're logged in as 'mallika', why is the file owned by root ??
Also, use this cmd
file a.out
to check what you've actually got there.
 
Old 02-18-2008, 06:29 PM   #5
Slokunshialgo
Member
 
Registered: Jan 2006
Distribution: Ubuntu 9.04, Fedora 10
Posts: 76

Rep: Reputation: 17
Another thing to try would be

> gcc sc1.c -o sc1
> ./sc1


The -o sc1 means make the executable output to a file called sc1, rather than the default a.out. I doubt it'll help, but it's worth a try.
 
Old 02-18-2008, 08:02 PM   #6
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 75
Also, make sure the partition on which the executable resides is not mounted with noexec.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
bash: ./configure: No such file or directory zaphanol Linux - Software 17 02-09-2010 09:24 AM
file or directory? bash script efus Programming 3 04-26-2007 06:11 PM
bash: ./configure no such file or directory VIR3NT Linux - Software 2 04-22-2006 10:04 PM
bash: cd: My: No such file or directory Doug.Gentry Fedora 2 12-05-2004 02:53 PM
bash: ./configure: No such file or directory penguin_powered Mandriva 2 10-31-2004 06:06 PM


All times are GMT -5. The time now is 08:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration