Reputation: 4721
I am trying to compile on Linux the file at http://sourceforge.net/projects/desr/files/Release/desr-0.9.tgz/download .
When I run ./configure, everything works smoothly, until I type make. Then I get the following errors:
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
Any ideas what could be the problem?
Here is 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.
Upvotes: 1
Views: 6102
Reputation: 81
Even though this question is quite old, I will just add to the @Daniels answer.
For me the error was caused because of including the <cstring>
in source file after a header that had a class definition not terminated with a ;
.
Upvotes: 0
Reputation: 4273
One possible cause of this issue is that you have managed to somewhere get a #include <cstring>
inside a namespace block.
This results in setting the #define
for the include guard, stopping you from re-importing it anywhere else, but in the meantime loading all the symbols into your namespace instead of into global scope where they belong.
I sometimes make this mistake when I'm trying to put inline template definitions in a separate file from their declarations.
Upvotes: 2
Reputation: 31
I faced similar problem. In my case, the order of header file inclusion were as follows
#include <string> // for string class
#include <cstring> // for memcpy()
With this, I ran into above errors that you mention with gcc 4.6.3.
Switching the order of includes worked..
Upvotes: 3
Reputation: 587
When there is
#include <cstring>
the g++ compiler should put the declarations it itself includes into the std:: AND the global namespaces. It looks for some reason as if it is not doing that. Try replacing one instance of strcpy with std::strcpy .
Upvotes: 4