未找到 stdarg.h

发布于 2024-11-29 05:25:13 字数 913 浏览 1 评论 0原文

我正在使用 clang 来编译 C++。我使用 clang *.cc -o ray 调用 clang。但是,我收到此错误消息:

-- 模式:编译;默认目录:“~/Programmeren/ray/”--
编译于8月11日星期四14:50:30开始

clang *.cc -o ray 在 Engine.cc 包含的文件中:1:在包含的文件中
来自 ./Prefix.hh:1:包含在
的文件中 /usr/include/c++/4.2.1/string:46:包含在
的文件中 /usr/include/c++/4.2.1/bits/char_traits.h:45:包含在
的文件中 /usr/include/c++/4.2.1/bits/stl_algobase.h:70:包含在
的文件中 /usr/include/c++/4.2.1/iosfwd:44:包含在
的文件中 /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/c++locale.h:49:
在 /usr/include/c++/4.2.1/cstdarg:50:
包含的文件中 /usr/include/stdarg.h:4:15:致命错误:找不到“stdarg.h”文件
#include_next
^ 生成 1 个错误。
编译于 8 月 11 日星期四 14:50:30 异常退出,代码为 1

Prefix.hh 中,我包含了几个文件,包括 #include

可能是什么问题?

I am using clang to compile C++. I invoke clang using clang *.cc -o ray. However, I get this error message:

-- mode: compilation; default-directory: "~/Programmeren/ray/" --
Compilation started at Thu Aug 11 14:50:30

clang *.cc -o ray In file included from Engine.cc:1: In file included
from ./Prefix.hh:1: In file included from
/usr/include/c++/4.2.1/string:46: In file included from
/usr/include/c++/4.2.1/bits/char_traits.h:45: In file included from
/usr/include/c++/4.2.1/bits/stl_algobase.h:70: In file included from
/usr/include/c++/4.2.1/iosfwd:44: In file included from
/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/c++locale.h:49:
In file included from /usr/include/c++/4.2.1/cstdarg:50:
/usr/include/stdarg.h:4:15: fatal error: 'stdarg.h' file not found
#include_next <stdarg.h>
^ 1 error generated.
Compilation exited abnormally with code 1 at Thu Aug 11 14:50:30

In Prefix.hh I include several files, including #include <string>.

What could be the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

浅忆 2024-12-06 05:25:13

我将 clang 2.1 复制到 /usr/bin。

这很可能是导致您出现问题的原因。不要这样做,“那个”是将一个系统软件从一个目录移动到另一个目录。这对于很多 UNIX 系统软件来说是行不通的。此类应用程序通常依赖于可执行文件的位置来指示该应用程序所需的文件的位置。这就是为什么这些应用程序的 makefile 通常具有非常复杂的 install 目标。

要做的事情是使用 make install 目标而不是 mv。更好的是,只需将其保留在构建位置并修改搜索路径,以便目标目录位于 /usr/bin 之前。保留 /usr/bin 。该目录不是您可以修改的。

附录
fink ( http://www.finkproject.org ) 和 MacPorts ( http://www.macports.org ) 触及 /usr/bin。这些项目的开发人员更了解。我强烈鼓励您跟随他们的领导。更好的是,使用其中一种(或两种)工具来管理您移植的应用程序。

I copied clang 2.1 over to /usr/bin.

This most likely is the cause of your problems. Don't do that, where "that" is moving a piece of system software from one directory to another. This just doesn't work with a lot of UNIX system software. Such applications often depend on the location of the executable to indicate the location of files needed by that application. This is why the makefiles for these applications often have very involved install targets.

The thing to do is to use make install target rather than mv. Better yet, just leave it where it was built and modify your search path so that the target directory is before /usr/bin. Leave /usr/bin alone. That directory is not yours to modify.

Addendum
Neither fink ( http://www.finkproject.org ) nor MacPorts ( http://www.macports.org ) touches /usr/bin. The developers of those projects know better. I strongly encourage you to follow their lead. Even better, use one (or both) of those tools to manage your ported applications.

请别遗忘我 2024-12-06 05:25:13

当我尝试构建和运行程序时出现此错误。经过多次试验,我发现在我重新排列一些文件夹之前,所有应用程序都运行良好,并且只有在文件夹洗牌后才会出现此错误。所以我放回文件夹并尝试。即使这样,这个错误仍然存​​在。重新安装 iOS(此处为 4.2)后,应用程序开始正常工作。

如果您仍在寻找解决方案,您可以尝试此方法。如果您找到任何其他解决方案
我想通过您提供的细节来丰富知识。

This error come up while trying to build and run a program by me. After many trials I found that all Apps worked well just before I rearranged some of my folders and this error has come up only after folders shuffle. So I put back the folders and tried. Even then this error persisted. On re installing iOS (4.2 here) the Apps started working fine.

If you are still looking for a solution you may try this. If you have found any other solution
I would like to get enriched in knowledge by your giving details.

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