Go Back   PCMech Forums > Linux Support > Linux OS and Software Assistance

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 09-24-2002, 02:11 PM   #1
Member (7 bit)
 
LoveJones's Avatar
 
Join Date: Sep 2002
Posts: 93
Pissed Typing program name at Terminal prompt in Linux, is not running the prog!

I am doing a little refresher self-study of C++ before school starts on Friday.

I just successfully compiled my program and renamed the output to "orc."

I am not sure if that was an important file I over-wrote, or if there is something else I am doing, because if I type "orc," at the command prompt it gives me the error that the command cannot be found.

bash: orc: command cannot be found

Or something to that effect.

I even tried renaming the output to other names and nothing works. I even compiled and let it name the file the default name "a.out" and that doesn't run either.

This is my exact syntax...

g++ orc.cpp -o orc

I have been able to run the program using gdb.

Any and all help or suggestions much appreciated. I am still pretty green to Linux so it might be a simple problem. And just to be clear I am working in the same directory the entire time.
LoveJones is offline   Reply With Quote
Old 09-24-2002, 03:05 PM   #2
Member (9 bit)
 
Join Date: Jan 2001
Location: East Coast, USA
Posts: 320
Send a message via AIM to TMAN
you must type ./orc for it to work. orc implies it is a registered system command. HTH
TMAN is offline   Reply With Quote
Old 09-24-2002, 03:21 PM   #3
Member (7 bit)
 
LoveJones's Avatar
 
Join Date: Sep 2002
Posts: 93
OK, I will give that a try.

Maybe it's been a while but when I was programming in c, I simply had to type the name, but that makes sense!

Thanks for your help!!
LoveJones is offline   Reply With Quote
Old 09-24-2002, 04:20 PM   #4
Member (7 bit)
 
LoveJones's Avatar
 
Join Date: Sep 2002
Posts: 93
Just to follow up, your suggestion worked! Thank you very much! =)
LoveJones is offline   Reply With Quote
Old 09-26-2002, 07:53 AM   #5
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
Quote:
Originally posted by LoveJones
OK, I will give that a try.

Maybe it's been a while but when I was programming in c, I simply had to type the name, but that makes sense!

Thanks for your help!!
This has nothing to do with C programming, in Linux CLI if you want to execute a file, either its path should be in the PATH env variable, so you simply type its name and hit enter, or you should be in its directory and type ./filename and hit enter.
In DOS, no need for the ./
aym is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 03:29 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2