Results 1 to 10 of 10
Why I cannot run the compiled executable file (the 'diamond' file) in other pc but just can run in the pc which compiles it?
Any solution for it?
Thanks in ...
- 12-22-2008 #1Just Joined!
- Join Date
- Nov 2008
- Posts
- 25
[SOLVED]Why I cannot run the compiled executable in other pc?
Why I cannot run the compiled executable file (the 'diamond' file) in other pc but just can run in the pc which compiles it?
Any solution for it?
Thanks in advanced. Nice day.
- 12-22-2008 #2If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 12-22-2008 #3Just Joined!
- Join Date
- Nov 2008
- Posts
- 25
this is an executable file my friend sent to me. I didn't have the source code to recompile it. By the way, he was using Ubuntu 7.10 to compile it and i was using Ubuntu 7.10 to run the executable as well.
The error message i get was
christyyim@christyyim-desktop:~/Desktop$ ./abc
bash: ./abc: Permission denied
Is it because different pc, the C compiler compile the source code in different path and cause me cannot run the executable file?
ps:
I didn't know about what 32bits or 64bits. Can you explain some?
- 12-22-2008 #4
Type "man chmod" and pay close attention to the letter "x".
Debian GNU/Linux -- You know you want it.
- 12-22-2008 #5
It sounds like you need execute permissions
In the terminal type
chmod +x will make the program executable and then you can run itCode:chmod +x abc ./abc
64 bit operating systems are for 64 bit processors. A 64 bit processor can run 32 bit software but a 32 bit processor can't run 64 bit software.
[edit]Beaten to it
[/edit]
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 12-22-2008 #6Just Joined!
- Join Date
- Nov 2008
- Posts
- 25
Yeah~~~ it works!!!!!!
Thanks guys!!!
By the way, what problem cause this error?
- 12-22-2008 #7
it needed to be made executable in order to run it
- 12-22-2008 #8
On a properly configured Linux system even executable files are not executable by default. You need to give a user execute permission to the file, otherwise you will get the permission denied error as you saw.
This is yet another layer of Malware protection built in to Linux.If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 12-23-2008 #9Just Joined!
- Join Date
- Nov 2008
- Posts
- 25
Thanks a lot, I get it.
- 12-23-2008 #10
elija is basically correct, but I want to clarify one point.
Linux has no concept of "executable" files. All files are simply a collection of bytes in a certain order.
However, every file has three permissions associated with it: read, write, and execute. The execute permission says that user has permission to actually attempt to follow whatever instructions are in this file.
In the case of a compiled binary, the format of the file is probably ELF. If you ever compile your own kernel, you will see that you have the choice to compile support for different binary formats, one of which is ELF.
In the case of a script, the first line of the script is called the shebang line. This is a special sequence that the OS understands that it will use to attempt to execute the script.
So in order to execute a program, you need to have executable permissions on it. The chmod program modifies user permissions on a file, so this is how you can grant yourself execute permissions.
I hope that makes sense, and glad you got it working.DISTRO=Arch
Registered Linux User #388732


Reply With Quote
