2012-03-26 74 views
2

我想在Linux上编译文件http://sourceforge.net/projects/desr/files/Release/desr-0.9.tgz/download如何在编译C++代码时修复一些版本问题?

当我运行./configure时,一切正常,直到我输入make。 然后我得到以下错误:

In file included from ./string.h:33, 
       from HtmlTokenizer.cpp:24: 
/usr/include/c++/4.4/cstring:76: error: ‘::memchr’ has not been declared 
/usr/include/c++/4.4/cstring:77: error: ‘::memcmp’ has not been declared 
/usr/include/c++/4.4/cstring:78: error: ‘::memcpy’ has not been declared 
/usr/include/c++/4.4/cstring:79: error: ‘::memmove’ has not been declared 
/usr/include/c++/4.4/cstring:80: error: ‘::memset’ has not been declared 
/usr/include/c++/4.4/cstring:81: error: ‘::strcat’ has not been declared 
/usr/include/c++/4.4/cstring:82: error: ‘::strcmp’ has not been declared 
/usr/include/c++/4.4/cstring:83: error: ‘::strcoll’ has not been declared 
/usr/include/c++/4.4/cstring:84: error: ‘::strcpy’ has not been declared 
/usr/include/c++/4.4/cstring:85: error: ‘::strcspn’ has not been declared 
/usr/include/c++/4.4/cstring:86: error: ‘::strerror’ has not been declared 
/usr/include/c++/4.4/cstring:87: error: ‘::strlen’ has not been declared 
/usr/include/c++/4.4/cstring:88: error: ‘::strncat’ has not been declared 
/usr/include/c++/4.4/cstring:89: error: ‘::strncmp’ has not been declared 
/usr/include/c++/4.4/cstring:90: error: ‘::strncpy’ has not been declared 
/usr/include/c++/4.4/cstring:91: error: ‘::strspn’ has not been declared 
/usr/include/c++/4.4/cstring:92: error: ‘::strtok’ has not been declared 
/usr/include/c++/4.4/cstring:93: error: ‘::strxfrm’ has not been declared 
/usr/include/c++/4.4/cstring:94: error: ‘::strchr’ has not been declared 
/usr/include/c++/4.4/cstring:95: error: ‘::strpbrk’ has not been declared 
/usr/include/c++/4.4/cstring:96: error: ‘::strrchr’ has not been declared 
/usr/include/c++/4.4/cstring:97: error: ‘::strstr’ has not been declared 

任何想法可能是什么问题呢?

这里是G ++ --version:

g++ (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3 
Copyright (C) 2009 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

回答

3

当有

#include <cstring> 

g ++编译器应该把它本身就包含到STD声明::和全局命名空间。它寻找某种原因,好像它没有这样做。尝试用std :: strcpy替换一个strcpy实例。

+0

的生成文件可以供给其避免了标准的列入一个编译器标记包括路径。 – enobayram 2012-03-26 19:45:47

3

我面临类似的问题。在我的情况下,头文件包含的排列顺序为

#include <string> // for string class 
#include <cstring> // for memcpy() 

有了这个,我遇到了,你用gcc 4.6.3提及上述错误。

开关的工作包括顺序..