gpt4 book ai didi

c++ - 未找到 stdarg.h

转载 作者:太空狗 更新时间:2023-10-29 20:46:50 30 4
gpt4 key购买 nike

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

-- 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

Prefix.hh我包含了几个文件,包括 #include <string> .

可能是什么问题?

最佳答案

I copied clang 2.1 over to /usr/bin.

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

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

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

关于c++ - 未找到 stdarg.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7026205/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com