LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-02-2005, 09:19 AM   #1
klmbrt
Member
 
Registered: Jan 2005
Location: Arkansas
Distribution: Fedora 4 & Lunar
Posts: 43

Rep: Reputation: 15
running compiled c++ programs in Fedora


Whenever I compile my programs and finally get no errors I see the a.out file and when I type a.out I get this error message:
-bash: a.out: command not found
WHY?
 
Old 03-02-2005, 09:24 AM   #2
Freyr
LQ Newbie
 
Registered: Jan 2005
Distribution: Arch Linux 0.7
Posts: 24

Rep: Reputation: 15
To execute a compiled file from a bash prompt you need to use the command

./a.out
 
Old 03-02-2005, 09:54 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
linux only uses the path environment to search for commands.

./ is a shortcut for the current working directory.
 
  


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
How to remove compiled programs? piggysmile Linux - Software 2 03-22-2005 05:25 AM
Searching compiled installed programs minm Linux - Newbie 2 09-14-2004 01:40 PM
Running programs compiled under RH9 Pazabo Fedora 2 08-30-2004 09:54 AM
why ./ is used to run C++ compiled programs legend1079 Red Hat 4 03-23-2004 06:32 AM
cannot run C compiled programs Astro Slackware 7 01-27-2004 10:32 PM

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

All times are GMT -5. The time now is 03:18 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