[gcc] make: *** [ ] Error 1 error

I am trying to compile a Pro*C file on gcc and I am getting this error :

make: *** [MedLib_x.o] Error 1

This is the command printed by make:

   /usr/bin/gcc -g -fPIC -m64 -DSS_64BIT_SERVER  -I/home/med/src/common -
I/u01/app/oradb11r2/product/11.2.0/dbhome_3/rdbms/demo 
-I/u01/app/oradb11r2/product/11.2.0/dbhome_3/rdbms/public 
-I/u01/app/oradb11r2/product/11.2.0/dbhome_3/precomp/public 
-I/u01/app/oradb11r2/product/11.2.0/dbhome_3/xdk/include INCLUDE=/u01/app/oradb11r2/product/11.2.0/dbhome_3/precomp/public -lnapi -ltabs -c MedLib_x.c

Please help me why this make error is coming? Although object file is also created.

This question is related to gcc makefile

The answer is


Sometimes you will get lots of compiler outputs with many warnings and no line of output that says "error: you did something wrong here" but there was still an error. An example of this is a missing header file - the compiler says something like "no such file" but not "error: no such file", then it exits with non-zero exit code some time later (perhaps after many more warnings). Make will bomb out with an error message in these cases!


From GNU Make error appendix, as you see this is not a Make error but an error coming from gcc.

‘[foo] Error NN’ ‘[foo] signal description’ These errors are not really make errors at all. They mean that a program that make invoked as part of a recipe returned a non-0 error code (‘Error NN’), which make interprets as failure, or it exited in some other abnormal fashion (with a signal of some type). See Errors in Recipes. If no *** is attached to the message, then the subprocess failed but the rule in the makefile was prefixed with the - special character, so make ignored the error.

So in order to attack the problem, the error message from gcc is required. Paste the command in the Makefile directly to the command line and see what gcc says. For more details on Make errors click here.


In my case there was a static variable which was not initialized. When I initialized it, the error was removed. I don't know the logic behind it but worked for me. I know its a little late but other people with similar problem might get some help.


I got the same thing. Running "make" and it fails with just this message.

% make
make: *** [all] Error 1

This was caused by a command in a rule terminates with non-zero exit status. E.g. imagine the following (stupid) Makefile:

all:
       @false
       echo "hello"

This would fail (without printing "hello") with the above message since false terminates with exit status 1.

In my case, I was trying to be clever and make a backup of a file before processing it (so that I could compare the newly generated file with my previous one). I did this by having a in my Make rule that looked like this:

@[ -e $@ ] && mv $@ [email protected]

...not realizing that if the target file does not exist, then the above construction will exit (without running the mv command) with exit status 1, and thus any subsequent commands in that rule failed to run. Rewriting my faulty line to:

@if [ -e $@ ]; then mv $@ [email protected]; fi

Solved my problem.