make: *** [ ] 错误 1 ​​错误

发布于 2024-10-30 02:27:14 字数 585 浏览 2 评论 0原文

我正在尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

你在看孤独的风景 2024-11-06 02:27:14

从 GNU Make 错误附录中可以看出,这不是 Make 错误,而是来自 gcc 的错误。

'[foo] 错误 NN'
'[foo]信号描述'
这些错误根本不是真正的错误。它们意味着作为配方的一部分调用的程序返回了非 0 错误代码(“错误 NN”),该代码将 make 解释为失败,或者以其他异常方式退出(带有某种类型的信号)。请参阅食谱中的错误。
如果消息中没有附加 ***,则子进程失败,但 makefile 中的规则以 - 特殊字符为前缀,因此 make 忽略该错误。

因此,为了解决这个问题,需要 gcc 的错误消息。将Makefile中的命令直接粘贴到命令行中,看看gcc说什么。 有关 Make 错误的更多详细信息,请单击此处。

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.

不知所踪 2024-11-06 02:27:14

我也得到同样的东西。运行“make”,它失败并仅显示此消息。

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

这是由规则中的命令以非零退出状态终止引起的。例如,想象以下(愚蠢的)Makefile

all:
       @false
       echo "hello"

这将失败(不打印“hello”)并显示上述消息,因为 false 以退出状态 1 终止。

在我的例子中,我试图聪明地在处理文件之前对其进行备份(以便我可以将新生成的文件与以前的文件进行比较)。我通过在我的 Make 规则中执行此操作,如下所示:

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

...没有意识到如果目标文件不存在,则上述构造将退出(不运行 mv 命令),退出状态为 1,因此该规则中的任何后续命令都无法运行。将我的错误行重写为:

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

解决了我的问题。

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.

笑着哭最痛 2024-11-06 02:27:14

有时你会得到很多编译器输出,其中有很多警告,但没有一行
的输出说
“错误:你在这里做错了什么”
但仍然出现错误。一个例子是缺少头文件 - 编译器会说“没有这样的文件”,但不是“错误:没有这样的文件”,然后在一段时间后(可能在更多警告之后)以非零退出代码退出。在这些情况下,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!

奢欲 2024-11-06 02:27:14

就我而言,有一个未初始化的静态变量。当我初始化它时,错误被删除。我不知道其背后的逻辑,但对我有用。我知道有点晚了,但其他有类似问题的人可能会得到一些帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文