Hi ,
When i am compiling my code with makefiles(I have 12 makefiles) there is an error telling "make.exe[1]: Leaving directory Error 2" whats the reason for this..? Also what is the "Error 2 or Error 1 " mean...?
Regards
Renjith G
Hi ,
When i am compiling my code with makefiles(I have 12 makefiles) there is an error telling "make.exe[1]: Leaving directory Error 2" whats the reason for this..? Also what is the "Error 2 or Error 1 " mean...?
Regards
Renjith G
Error 2, in unix systems means ENOENT
. In english "No such file or directory". Your makefile referenced a file or directory that did not exist, and make was unable to recover from the error.
When make prints "Error 2" in this context it just means that there was an error in a recursive make invocation. You have to look at the error messages preceeding that message to determine what the real problem was, in the submake. For example, given a Makefile like this:
all:
$(MAKE) -f sub.mk
... and a sub.mk like this:
all:
@exit 1
When I run GNU make, it prints the following:
gmake -f sub.mk
gmake[1]: Entering directory `/tmp/foo'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory `/tmp/foo'
gmake: *** [all] Error 2
Error 2
tells me that there was an error of some sort in the submake. I have to look above that message, to the Error 1
message from the submake itself. There I can see that some command invoked while trying to build all
exited with exit code 1. Unfortunately there's not really a standard that defines exit codes for applications, beyond the trivial "exit code 0 means OK". You have to look at the particular command that failed and check its documentation to determine what the specific exit code means.
These error messages have nothing to do with Unix errno values as others have stated. The outermost "2" is just the error code that make itself assigns when a submake has an error; the inner "1" is just the exit code of a failed command. It could just as easily be "7" or "11" or "42".