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.
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.
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!
I got the same thing. Running "make" and it fails with just this message.
This was caused by a command in a rule terminates with non-zero exit status. E.g. imagine the following (stupid)
Makefile
: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:...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:Solved my problem.
From GNU Make error appendix, as you see this is not a Make error but an error coming from gcc.
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.