linux - compiled C file not executable -
So when I try to run a compiled program on my school's "Hercules" server, Expect service me However, I've got an assignment for which to use the fork is necessary, and running a program that the fork is denied on that server, instead, I'm running it from remote machines connecting and running from several Linux machines , From the command line
However, any attempt to do this gives me this error:
shell2: Exec format error The binary file is not executable Overall, my command prompt looks like this:
a049403 [8]% shell2 shell2: Exec format error . The binary file is not executable The shell file is found in the directory I have working in, when I type "ls", it shows it with the * character, indicating Does that make it executable. I have tried to set my permissions for 777. This generates the same error for other C programs which I was working and was running, and "Hercules" could run the exact same file without any difficulties or complaints. My make file for this special event looks like this:
All: Shell2 Basics.O: Basics C Basics. Cc-C Basics Doublinked.o: doublelinked.c doublelinked.h cc-c double-linked.q. head.o: main c basics.h. Double-Linked. CC-C main c. Shell2: Main.o Basics.O Double Linked To CC Main.o Basics.O Double Linked.O-O Shell 2 Clean: Rm -f * o shell2 ... and If I run the makefile again, then it seems that there is no problem.
So, the reasons why an environment that can compile a program will not be able to run them? Any possible remedy?
First of all, your makefile is not very good to look and correct it for. Then, a possible explanation
Why your binary The libc version may not be mismatched on the program target machine. Or maybe a system is 32 bits and the second is 64 bits. Use file shell2 to find out. I suggest that the target machine on clear then recompile it again (such as all ). Learn how.
Comments
Post a Comment