Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

gcc

makefile

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.

like image 718
QMG Avatar asked Apr 04 '11 07:04

QMG


2 Answers

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.

like image 80
fnokke Avatar answered Sep 30 '22 20:09

fnokke


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.

like image 36
zrajm Avatar answered Sep 30 '22 19:09

zrajm