[SOLVED] C++ program compiled in Fedora 14 do not run
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am very new in c programming. I could not get a simple compiled program to run, I am using Fedora 14. To learn the correct way I sign in to http://mrbook.org/tutorial/make/ and fallow the examples listed they all compile and generate the executable file but none run. To run them I try both way double chick the executable end on the command line but it does not do any thing. I will appreciate help, Vinny
Obligatory comment:
That only works if the current directory (".") is in your PATH. If typing "hello.x" gives a "command not found" error, then try:
Code:
./hello.x
Also, please post the contents of your Makefile. That will tell us the name of the program being created and what directory it is saved to.
EDIT:
The OP's link is incorrect. It gives a 404 error. I believe this is the correct link: Mrbook's Tutorial on Makefiles
-----------
I am not sure where to attach my reply, please correct me if I am using in wrong location.
sorry for wrong address, I try all the samples in that paper, here is one:
I think that my reply may belong here.
-----------
I am not sure where to attach my reply, please correct me if I am using in wrong location.
sorry for wrong address, I try all the samples in that paper, here is one:
I think that my reply may belong here.
-----------
I am not sure where to attach my reply, please correct me if I am using in wrong location.
sorry for wrong address, I try all the samples in that paper, here is one:
clean:
rm -rf *o hello
This create hello executable file, but when I try to run it does not do any thing.
is it not printing an error like 'command no found' ?
please post the contents of hello.cpp. i suspect that it doesnt have a printf/ cout so it looks like its not doing anything.
Linux shell forbids running of executables without explicit ./ if the executable is not located in one of the PATH directory.
See :
Code:
echo $PATH
This prevents running of executables you are not aware of, can be a malware , backdors , etc.
Also you have to make the file executable in order to be able to run it, this is what chmod +x did.
You can check if the file is executable by running :
Code:
ls -l ./hello.x
Check this link for more details about permissions.
Last edited by goodhombre; 02-03-2011 at 07:45 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.