- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在使用 clang 编译 C++。我使用 clang *.cc -o ray
调用 clang .但是,我收到此错误消息:
-- mode: compilation; default-directory: "~/Programmeren/ray/" --
Compilation started at Thu Aug 11 14:50:30clang *.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/
在我的系统(Mac OS 10.6)上,/usr/include/stdarg.h是: /* This file is public domain. */ /* GCC uses its own c
我遇到了一个竞争性问题,要求输出以下内容(请忽略该问题的软件工程问题,如果有的话,因为这是一个学术示例,但是如果它与该问题相关,请详细说明): #include #include int ripp
void wczytaj(N nazwa, O x1, ...) { va_list arg; O x; ... va_start (arg, x1); for
我正在尝试使用 stdarg ( library) header 连接字符串,但我做错了。使用 realloc 连接字符串有更简单的方法吗? #include #include #include
我在 codegolf.stackexchange 网站上找到了这段代码。 #include #define function int #define var int struct { int (*
所以我一直在尝试将 stdarg 用于不确定的参数。对于 int,它工作得很好,但现在我正在尝试使用 char 指针。这是我的代码: void updateValue(char *parame
TL;DR:mprintf("%s and %s", arg1, arg2) 似乎打印 "arg1arg2 and arg2" 而不是 “arg1 和 arg2” 使用 stdarg.h 中定义的 v
有没有什么方法可以使用指针访问函数中的可变参数?我试着做类似的事情 void test(int p, ...) { int firstarg = *(&p - 1); } 但这不起作用。 va
我正在使用 clang 编译 C++。我使用 clang *.cc -o ray 调用 clang .但是,我收到此错误消息: -- mode: compilation; default-direct
在我的系统 (Mac OS 10.6) 上 /usr/include/stdarg.h 是: /* This file is public domain. */ /* GCC uses its ow
我正在试验可变参数列表并看到一些奇怪的结果... 我正在测试的代码是: #include #include void foo(int param1, int param2, ...) {
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我是 android ndk 的新手,我正在尝试制作一个完全原生的应用程序。我正在使用 Eclipse,我收到了这个警告: Unresolved inclusion: 以及我尝试在该 header
这似乎是 clang 中与空终止变量参数列表相关的错误。 预期的行为是 va_arg() 将在第一次迭代时返回 0,因为别名后面的参数是 0。 完整代码如下。在 main() 中,删除“void *m
我在我的项目中包含了 vsprintf。但是,当我编译它时,我收到以下错误。 /opt/xgcc/decstation-ultrix/bin/xgcc -DIN_USER_MODE -c -I../u
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我试图通过检查堆栈来理解和实现一种处理可变长度参数函数的方法,但我不知道从哪里开始以及如何开始。我发现以下链接很有用,但我仍然不太明白我如何能够在 c 中为打印功能之类的东西做这样的事情。 http:
我想要一个函数,当用不同数量的参数调用时,返回第一个非 NULL 参数。我试过这个,但它在 for 循环上进行了核心转储: char *first(char *args, ...) { va_
出于好奇,我希望为标准 C 库中的某些函数编写最少的替代品。至此,我已经完成了printf()、strlen()、strcpy()、memcpy()、 memset()等等...但是当我尝试使用pri
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Installing Python Imaging Library (PIL) on Snow Leopar
我是一名优秀的程序员,十分优秀!