LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-06-2008, 03:24 PM   #1
dangerousdave
Member
 
Registered: Feb 2005
Distribution: Ubuntu 8.04
Posts: 100

Rep: Reputation: 15
g++ include errors


Hey, I'm trying to get up and running using Eclipse, but I cant even do the simplest program. Literally a program with an empty main() function and just #include <iostream> gives a mass of errors. The only similar issue I can find on the web is when the file is named the same as an STL file, which is not the case for me. Copy/paste of errors below. Any help much appreciated!



In file included from /usr/include/c++/4.2/x86_64-linux-gnu/bits/c++locale.h:47,
from /usr/include/c++/4.2/iosfwd:45,
from /usr/include/c++/4.2/ios:43,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/cstring:80: error: ‘::memcpy’ has not been declared
/usr/include/c++/4.2/cstring:81: error: ‘::memmove’ has not been declared
/usr/include/c++/4.2/cstring:82: error: ‘::strcpy’ has not been declared
/usr/include/c++/4.2/cstring:83: error: ‘::strncpy’ has not been declared
/usr/include/c++/4.2/cstring:84: error: ‘::strcat’ has not been declared
/usr/include/c++/4.2/cstring:85: error: ‘::strncat’ has not been declared
/usr/include/c++/4.2/cstring:86: error: ‘::memcmp’ has not been declared
/usr/include/c++/4.2/cstring:87: error: ‘::strcmp’ has not been declared
/usr/include/c++/4.2/cstring:88: error: ‘::strcoll’ has not been declared
/usr/include/c++/4.2/cstring:89: error: ‘::strncmp’ has not been declared
/usr/include/c++/4.2/cstring:90: error: ‘::strxfrm’ has not been declared
/usr/include/c++/4.2/cstring:91: error: ‘::strcspn’ has not been declared
/usr/include/c++/4.2/cstring:92: error: ‘::strspn’ has not been declared
/usr/include/c++/4.2/cstring:93: error: ‘::strtok’ has not been declared
/usr/include/c++/4.2/cstring:94: error: ‘::memset’ has not been declared
/usr/include/c++/4.2/cstring:95: error: ‘::strerror’ has not been declared
/usr/include/c++/4.2/cstring:96: error: ‘::strlen’ has not been declared
/usr/include/c++/4.2/cstring:98: error: ‘::memchr’ has not been declared
/usr/include/c++/4.2/cstring: In function ‘void* std::memchr(void*, int, size_t)’:
/usr/include/c++/4.2/cstring:102: error: invalid conversion from ‘const void*’ to ‘void*’
/usr/include/c++/4.2/cstring:102: error: initialising argument 1 of ‘void* std::memchr(void*, int, size_t)’
/usr/include/c++/4.2/cstring: At global scope:
/usr/include/c++/4.2/cstring:104: error: ‘::strchr’ has not been declared
/usr/include/c++/4.2/cstring:110: error: ‘::strpbrk’ has not been declared
/usr/include/c++/4.2/cstring:116: error: ‘::strrchr’ has not been declared
/usr/include/c++/4.2/cstring:122: error: ‘::strstr’ has not been declared
In file included from /usr/include/c++/4.2/bits/char_traits.h:46,
from /usr/include/c++/4.2/ios:45,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/stl_algobase.h: In static member function ‘static _Tp* std::__copy<true, std::random_access_iterator_tag>::copy(const _Tp*, const _Tp*, _Tp*)’:
/usr/include/c++/4.2/bits/stl_algobase.h:298: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In static member function ‘static _Tp* std::__copy_backward<true, std::random_access_iterator_tag>::__copy_b(const _Tp*, const _Tp*, _Tp*)’:
/usr/include/c++/4.2/bits/stl_algobase.h:446: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘void std::fill(unsigned char*, unsigned char*, const unsigned char&)’:
/usr/include/c++/4.2/bits/stl_algobase.h:600: error: ‘memset’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘void std::fill(signed char*, signed char*, const signed char&)’:
/usr/include/c++/4.2/bits/stl_algobase.h:608: error: ‘memset’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘void std::fill(char*, char*, const char&)’:
/usr/include/c++/4.2/bits/stl_algobase.h:616: error: ‘memset’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘bool std::lexicographical_compare(const unsigned char*, const unsigned char*, const unsigned char*, const unsigned char*)’:
/usr/include/c++/4.2/bits/stl_algobase.h:908: error: ‘memcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/ios:45,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static typename __gnu_cxx::char_traits<_CharT>::char_type* __gnu_cxx::char_traits<_CharT>::move(_CharT*, const _CharT*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:186: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static int std::char_traits<char>::compare(const char*, const char*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:254: error: ‘memcmp’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static size_t std::char_traits<char>::length(const char*)’:
/usr/include/c++/4.2/bits/char_traits.h:258: error: ‘strlen’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static const char* std::char_traits<char>::find(const char*, size_t, const char&)’:
/usr/include/c++/4.2/bits/char_traits.h:262: error: invalid conversion from ‘const void*’ to ‘void*’
/usr/include/c++/4.2/bits/char_traits.h:262: error: initialising argument 1 of ‘void* std::memchr(void*, int, size_t)’
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static char* std::char_traits<char>::move(char*, const char*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:266: error: ‘memmove’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static char* std::char_traits<char>::copy(char*, const char*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:270: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static char* std::char_traits<char>::assign(char*, size_t, char)’:
/usr/include/c++/4.2/bits/char_traits.h:274: error: ‘memset’ was not declared in this scope
In file included from /usr/include/c++/4.2/memory:57,
from /usr/include/c++/4.2/string:48,
from /usr/include/c++/4.2/bits/locale_classes.h:47,
from /usr/include/c++/4.2/bits/ios_base.h:47,
from /usr/include/c++/4.2/ios:48,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/stl_uninitialized.h: In function ‘char* std::uninitialized_copy(const char*, const char*, char*)’:
/usr/include/c++/4.2/bits/stl_uninitialized.h:120: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_uninitialized.h: In function ‘wchar_t* std::uninitialized_copy(const wchar_t*, const wchar_t*, wchar_t*)’:
/usr/include/c++/4.2/bits/stl_uninitialized.h:128: error: ‘memmove’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/ios_base.h:47,
from /usr/include/c++/4.2/ios:48,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_classes.h: In member function ‘bool std::locale::_Impl::_M_check_same_name()’:
/usr/include/c++/4.2/bits/locale_classes.h:539: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘const char* std::ctype<char>::widen(const char*, const char*, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:898: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘const char* std::ctype<char>::narrow(const char*, const char*, char, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:963: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘virtual const char* std::ctype<char>::do_widen(const char*, const char*, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:1100: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘virtual const char* std::ctype<char>::do_narrow(const char*, const char*, char, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:1153: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘void std::ctype<char>::_M_widen_init() const’:
/usr/include/c++/4.2/bits/locale_facets.h:1168: error: ‘memcmp’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘void std::ctype<char>::_M_narrow_init() const’:
/usr/include/c++/4.2/bits/locale_facets.h:1183: error: ‘memcmp’ was not declared in this scope
In file included from /usr/include/c++/4.2/bits/locale_facets.h:1536,
from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/codecvt.h: In constructor ‘std::codecvt_byname<_InternT, _ExternT, _StateT>::codecvt_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/codecvt.h:460: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/codecvt.h:460: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_facets.h: In constructor ‘std::numpunct_byname<_CharT>::numpunct_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/locale_facets.h:1904: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h:1904: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h: In constructor ‘std::collate_byname<_CharT>::collate_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/locale_facets.h:2726: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h:2726: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/locale_facets.h:3040,
from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/time_members.h: In constructor ‘std::__timepunct<_CharT>::__timepunct(__locale_struct*, const char*, size_t)’:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/time_members.h:62: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/time_members.h:64: error: ‘memcpy’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_facets.h: In constructor ‘std::moneypunct_byname<_CharT, _Intl>::moneypunct_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/locale_facets.h:4014: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h:4014: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/locale_facets.h:4599,
from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h: In constructor ‘std::messages<_CharT>::messages(__locale_struct*, const char*, size_t)’:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:55: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:57: error: ‘memcpy’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h: In constructor ‘std::messages_byname<_CharT>::messages_byname(const char*, size_t)’:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:105: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:106: error: ‘strcpy’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:109: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:109: error: ‘strcmp’ is not a member of ‘std’
make: *** [MainApp.o] Error 1
make: Target `all' not remade because of errors.
 
Old 05-07-2008, 09:08 AM   #2
LordAnta
Member
 
Registered: Apr 2008
Location: Bucharest, Romania
Distribution: Slackware current
Posts: 126

Rep: Reputation: 17
try these:

Code:
 #include <iostream>
 
 using namespace std;
 
Old 05-07-2008, 09:24 AM   #3
LordAnta
Member
 
Registered: Apr 2008
Location: Bucharest, Romania
Distribution: Slackware current
Posts: 126

Rep: Reputation: 17
try these:

Code:
 #include <iostream>
 
 using namespace std;
 
Old 01-14-2009, 01:55 AM   #4
zhoubeibei11
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by LordAnta View Post
try these:

Code:
 #include <iostream>
 
 using namespace std;
That doesn't work.
 
Old 01-14-2009, 01:57 AM   #5
zhoubeibei11
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by dangerousdave View Post
Hey, I'm trying to get up and running using Eclipse, but I cant even do the simplest program. Literally a program with an empty main() function and just #include <iostream> gives a mass of errors. The only similar issue I can find on the web is when the file is named the same as an STL file, which is not the case for me. Copy/paste of errors below. Any help much appreciated!



In file included from /usr/include/c++/4.2/x86_64-linux-gnu/bits/c++locale.h:47,
from /usr/include/c++/4.2/iosfwd:45,
from /usr/include/c++/4.2/ios:43,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/cstring:80: error: ‘::memcpy’ has not been declared
/usr/include/c++/4.2/cstring:81: error: ‘::memmove’ has not been declared
/usr/include/c++/4.2/cstring:82: error: ‘::strcpy’ has not been declared
/usr/include/c++/4.2/cstring:83: error: ‘::strncpy’ has not been declared
/usr/include/c++/4.2/cstring:84: error: ‘::strcat’ has not been declared
/usr/include/c++/4.2/cstring:85: error: ‘::strncat’ has not been declared
/usr/include/c++/4.2/cstring:86: error: ‘::memcmp’ has not been declared
/usr/include/c++/4.2/cstring:87: error: ‘::strcmp’ has not been declared
/usr/include/c++/4.2/cstring:88: error: ‘::strcoll’ has not been declared
/usr/include/c++/4.2/cstring:89: error: ‘::strncmp’ has not been declared
/usr/include/c++/4.2/cstring:90: error: ‘::strxfrm’ has not been declared
/usr/include/c++/4.2/cstring:91: error: ‘::strcspn’ has not been declared
/usr/include/c++/4.2/cstring:92: error: ‘::strspn’ has not been declared
/usr/include/c++/4.2/cstring:93: error: ‘::strtok’ has not been declared
/usr/include/c++/4.2/cstring:94: error: ‘::memset’ has not been declared
/usr/include/c++/4.2/cstring:95: error: ‘::strerror’ has not been declared
/usr/include/c++/4.2/cstring:96: error: ‘::strlen’ has not been declared
/usr/include/c++/4.2/cstring:98: error: ‘::memchr’ has not been declared
/usr/include/c++/4.2/cstring: In function ‘void* std::memchr(void*, int, size_t)’:
/usr/include/c++/4.2/cstring:102: error: invalid conversion from ‘const void*’ to ‘void*’
/usr/include/c++/4.2/cstring:102: error: initialising argument 1 of ‘void* std::memchr(void*, int, size_t)’
/usr/include/c++/4.2/cstring: At global scope:
/usr/include/c++/4.2/cstring:104: error: ‘::strchr’ has not been declared
/usr/include/c++/4.2/cstring:110: error: ‘::strpbrk’ has not been declared
/usr/include/c++/4.2/cstring:116: error: ‘::strrchr’ has not been declared
/usr/include/c++/4.2/cstring:122: error: ‘::strstr’ has not been declared
In file included from /usr/include/c++/4.2/bits/char_traits.h:46,
from /usr/include/c++/4.2/ios:45,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/stl_algobase.h: In static member function ‘static _Tp* std::__copy<true, std::random_access_iterator_tag>::copy(const _Tp*, const _Tp*, _Tp*)’:
/usr/include/c++/4.2/bits/stl_algobase.h:298: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In static member function ‘static _Tp* std::__copy_backward<true, std::random_access_iterator_tag>::__copy_b(const _Tp*, const _Tp*, _Tp*)’:
/usr/include/c++/4.2/bits/stl_algobase.h:446: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘void std::fill(unsigned char*, unsigned char*, const unsigned char&)’:
/usr/include/c++/4.2/bits/stl_algobase.h:600: error: ‘memset’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘void std::fill(signed char*, signed char*, const signed char&)’:
/usr/include/c++/4.2/bits/stl_algobase.h:608: error: ‘memset’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘void std::fill(char*, char*, const char&)’:
/usr/include/c++/4.2/bits/stl_algobase.h:616: error: ‘memset’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_algobase.h: In function ‘bool std::lexicographical_compare(const unsigned char*, const unsigned char*, const unsigned char*, const unsigned char*)’:
/usr/include/c++/4.2/bits/stl_algobase.h:908: error: ‘memcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/ios:45,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static typename __gnu_cxx::char_traits<_CharT>::char_type* __gnu_cxx::char_traits<_CharT>::move(_CharT*, const _CharT*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:186: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static int std::char_traits<char>::compare(const char*, const char*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:254: error: ‘memcmp’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static size_t std::char_traits<char>::length(const char*)’:
/usr/include/c++/4.2/bits/char_traits.h:258: error: ‘strlen’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static const char* std::char_traits<char>::find(const char*, size_t, const char&)’:
/usr/include/c++/4.2/bits/char_traits.h:262: error: invalid conversion from ‘const void*’ to ‘void*’
/usr/include/c++/4.2/bits/char_traits.h:262: error: initialising argument 1 of ‘void* std::memchr(void*, int, size_t)’
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static char* std::char_traits<char>::move(char*, const char*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:266: error: ‘memmove’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static char* std::char_traits<char>::copy(char*, const char*, size_t)’:
/usr/include/c++/4.2/bits/char_traits.h:270: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/char_traits.h: In static member function ‘static char* std::char_traits<char>::assign(char*, size_t, char)’:
/usr/include/c++/4.2/bits/char_traits.h:274: error: ‘memset’ was not declared in this scope
In file included from /usr/include/c++/4.2/memory:57,
from /usr/include/c++/4.2/string:48,
from /usr/include/c++/4.2/bits/locale_classes.h:47,
from /usr/include/c++/4.2/bits/ios_base.h:47,
from /usr/include/c++/4.2/ios:48,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/stl_uninitialized.h: In function ‘char* std::uninitialized_copy(const char*, const char*, char*)’:
/usr/include/c++/4.2/bits/stl_uninitialized.h:120: error: ‘memmove’ is not a member of ‘std’
/usr/include/c++/4.2/bits/stl_uninitialized.h: In function ‘wchar_t* std::uninitialized_copy(const wchar_t*, const wchar_t*, wchar_t*)’:
/usr/include/c++/4.2/bits/stl_uninitialized.h:128: error: ‘memmove’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/ios_base.h:47,
from /usr/include/c++/4.2/ios:48,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_classes.h: In member function ‘bool std::locale::_Impl::_M_check_same_name()’:
/usr/include/c++/4.2/bits/locale_classes.h:539: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘const char* std::ctype<char>::widen(const char*, const char*, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:898: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘const char* std::ctype<char>::narrow(const char*, const char*, char, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:963: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘virtual const char* std::ctype<char>::do_widen(const char*, const char*, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:1100: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘virtual const char* std::ctype<char>::do_narrow(const char*, const char*, char, char*) const’:
/usr/include/c++/4.2/bits/locale_facets.h:1153: error: ‘memcpy’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘void std::ctype<char>::_M_widen_init() const’:
/usr/include/c++/4.2/bits/locale_facets.h:1168: error: ‘memcmp’ was not declared in this scope
/usr/include/c++/4.2/bits/locale_facets.h: In member function ‘void std::ctype<char>::_M_narrow_init() const’:
/usr/include/c++/4.2/bits/locale_facets.h:1183: error: ‘memcmp’ was not declared in this scope
In file included from /usr/include/c++/4.2/bits/locale_facets.h:1536,
from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/codecvt.h: In constructor ‘std::codecvt_byname<_InternT, _ExternT, _StateT>::codecvt_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/codecvt.h:460: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/codecvt.h:460: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_facets.h: In constructor ‘std::numpunct_byname<_CharT>::numpunct_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/locale_facets.h:1904: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h:1904: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h: In constructor ‘std::collate_byname<_CharT>::collate_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/locale_facets.h:2726: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h:2726: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/locale_facets.h:3040,
from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/time_members.h: In constructor ‘std::__timepunct<_CharT>::__timepunct(__locale_struct*, const char*, size_t)’:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/time_members.h:62: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/time_members.h:64: error: ‘memcpy’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/bits/locale_facets.h: In constructor ‘std::moneypunct_byname<_CharT, _Intl>::moneypunct_byname(const char*, size_t)’:
/usr/include/c++/4.2/bits/locale_facets.h:4014: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/bits/locale_facets.h:4014: error: ‘strcmp’ is not a member of ‘std’
In file included from /usr/include/c++/4.2/bits/locale_facets.h:4599,
from /usr/include/c++/4.2/bits/basic_ios.h:44,
from /usr/include/c++/4.2/ios:50,
from /usr/include/c++/4.2/ostream:45,
from /usr/include/c++/4.2/iostream:45,
from ../MainApp.cpp:2:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h: In constructor ‘std::messages<_CharT>::messages(__locale_struct*, const char*, size_t)’:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:55: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:57: error: ‘memcpy’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h: In constructor ‘std::messages_byname<_CharT>::messages_byname(const char*, size_t)’:
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:105: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:106: error: ‘strcpy’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:109: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2/x86_64-linux-gnu/bits/messages_members.h:109: error: ‘strcmp’ is not a member of ‘std’
make: *** [MainApp.o] Error 1
make: Target `all' not remade because of errors.
Do you resolve? I wish your reply!
 
Old 01-14-2009, 05:31 PM   #6
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
What is the full command line for the compilation? It seems like it might be a #define (from the command line?) that's preventing a C header from being included by the C++ header.
ta0kira
 
Old 10-31-2010, 02:46 PM   #7
ruds
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
I just debugged this error. Necro'ing because it's high in the Google results when searching for the error message.

The problem is that a standard header was included from within a namespace. Example:

test.cc
Code:
namespace test {
#include test.h  // here's your problem
}
test.h
Code:
#include <cstring> // but it's hard to debug
 
Old 10-31-2010, 04:12 PM   #8
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Just to clarify:

1. C++ namespaces are Good.

2. It's OK to use namespaces inside a .cpp source file.
It's also OK to use namespaces inside a .h header file.

3. But you should #include your headers OUTSIDE of the namespace.

Code:
/*
 * EXAMPLE:
 * http://www.cplusplus.com/doc/tutorial/namespaces/
 */
// namespaces
#include <iostream>
using namespace std;

namespace first
{
  int var = 5;
}

namespace second
{
  double var = 3.1416;
}

int main () {
  cout << first::var << endl;
  cout << second::var << endl;
  return 0;
}
Code:
// using
#include <iostream>
using namespace std;

namespace first
{
  int x = 5;
  int y = 10;
}

namespace second
{
  double x = 3.1416;
  double y = 2.7183;
}

int main () {
  using first::x;
  using second::y;
  cout << x << endl;
  cout << y << endl;
  cout << first::y << endl;
  cout << second::x << endl;
  return 0;
}

Last edited by paulsm4; 10-31-2010 at 04:16 PM.
 
Old 11-01-2010, 12:43 AM   #9
ruds
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
Smile

Quote:
Just to clarify:

1. C++ namespaces are Good.

2. It's OK to use namespaces inside a .cpp source file.
It's also OK to use namespaces inside a .h header file.

3. But you should #include your headers OUTSIDE of the namespace.
Oh indeed. I took all that as a given. Sorry if I misled.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
QT 4 include files produce compiler errors in wrappers on C YuriyRusinov Linux - General 0 10-29-2007 04:38 AM
Differences between /usr/include/* and linux/include/* simopal6 Linux - General 2 08-26-2007 03:41 AM
changing include directories - /usr/local/include quep_fly Linux - Newbie 6 08-12-2007 04:36 PM
/usr/include/regex.h errors? gbowden Slackware 0 07-03-2007 11:03 AM
include/linux/types.h and include/linux/posix_types.h kpachopoulos Programming 2 11-26-2005 05:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration