c++ - 编译 C++ 代码时如何解决版本控制问题?

标签 c++ linux makefile

我正在尝试在 Linux 上编译位于 http://sourceforge.net/projects/desr/files/Release/desr-0.9.tgz/download 的文件.

当我运行 ./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.

最佳答案

有的时候

 #include <cstring> 

g++ 编译器应该将它自己包含的声明放入 std::和全局命名空间中。由于某种原因,它看起来好像没有那样做。尝试用 std::strcpy 替换一个 strcpy 实例。

关于c++ - 编译 C++ 代码时如何解决版本控制问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9877635/

相关文章:

linux - 如何在 linux 中使用 find 打印与我的文本匹配的行?

c - Unix:使用 Make 进行项目管理

c - makefile C 奇怪的 bash 命令行为

c++ - 为什么 VS2015 中模板相关的嵌套类型名称不需要 typename 关键字?

c++ - vector 迭代器在赋值重载中不兼容

c++ - 如何传递 ostream 并使用 cout 在函数中显示在屏幕上?

makefile - 在 Makefile $(info ...) 中使用制表符

c++ - 当范围变化时,复杂性是多少?

linux - chmod : missing operand after a+t

makefile - Ubuntu LDFLAGS --按需