Results 1 to 6 of 6
I installed g++ compiler on mandrake using urpmi command and am able to compile and create output files.
g++ -o first first.cpp
But I cant run this created output file.
...
- 02-25-2005 #1Just Joined!
- Join Date
- Feb 2005
- Location
- Los Angeles
- Posts
- 4
g++ compiler
I installed g++ compiler on mandrake using urpmi command and am able to compile and create output files.
g++ -o first first.cpp
But I cant run this created output file.
I also changed the file mode to 777 and tried running it. But it says not a valid command
Please throw some light on this,
Thanks,
Jaydeep
A NEWBIE
- 02-26-2005 #2Linux Newbie
- Join Date
- Aug 2004
- Posts
- 220
1st of all i'll make the asumption that you are runing the output file from a terminal.
2nd have you tried this?
Code:chmod u+x a.out
- 02-26-2005 #3Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
If the output is called 'first', are you running 'first' or './first'?
- 02-26-2005 #4Just Joined!
- Join Date
- Feb 2005
- Location
- Los Angeles
- Posts
- 4
I am running "first" and not ./first from a TERMINAL
Also , I changed the mode using the command
chmod -c 777 first
Thanks
Jaydeep
- 02-26-2005 #5Just Joined!
- Join Date
- Feb 2005
- Location
- Los Angeles
- Posts
- 4
it worked with ./first
Whts the difference between ./first and first ...
doesnt the command looks in the current directory unless specified ?
Jaydeep
- 02-26-2005 #6Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
Unless you have . in your path, then your current directory is not searched for executables, so you need to use ./ which means current directory. You could add . to your path to avoid this, but depending on where you put it and what you have in your current directory it may cause some minor annoyances with the program you want not being the one you run. Also, it is generally considered not good to do this for root.


Reply With Quote
