stdarg.h not found
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: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开发者_Go百科 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?
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.
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.
精彩评论