make: *** [ ] 错误 1 错误
我正在尝试在 gcc 上编译 Pro*C 文件,但收到此错误:
make: *** [MedLib_x.o] Error 1
这是 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
请帮助我为什么会出现此 make 错误?虽然也创建了目标文件。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
从 GNU Make 错误附录中可以看出,这不是 Make 错误,而是来自 gcc 的错误。
因此,为了解决这个问题,需要 gcc 的错误消息。将Makefile中的命令直接粘贴到命令行中,看看gcc说什么。 有关 Make 错误的更多详细信息,请单击此处。
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.
我也得到同样的东西。运行“make”,它失败并仅显示此消息。
这是由规则中的命令以非零退出状态终止引起的。例如,想象以下(愚蠢的)
Makefile
:这将失败(不打印“hello”)并显示上述消息,因为
false
以退出状态 1 终止。在我的例子中,我试图聪明地在处理文件之前对其进行备份(以便我可以将新生成的文件与以前的文件进行比较)。我通过在我的
Make
规则中执行此操作,如下所示:...没有意识到如果目标文件不存在,则上述构造将退出(不运行
mv
命令),退出状态为 1,因此该规则中的任何后续命令都无法运行。将我的错误行重写为:解决了我的问题。
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.
有时你会得到很多编译器输出,其中有很多警告,但没有一行
的输出说
“错误:你在这里做错了什么”
但仍然出现错误。一个例子是缺少头文件 - 编译器会说“没有这样的文件”,但不是“错误:没有这样的文件”,然后在一段时间后(可能在更多警告之后)以非零退出代码退出。在这些情况下,Make 将会崩溃并显示错误消息!
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!
就我而言,有一个未初始化的静态变量。当我初始化它时,错误被删除。我不知道其背后的逻辑,但对我有用。我知道有点晚了,但其他有类似问题的人可能会得到一些帮助。
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.