0

我正在从 CEGUI 构建一个示例,SDK 似乎很好解决,并且日志上有关 CEGUI 的进一步错误似乎是由于 MVS 中包含的错误而出现的。我不能肯定这一点,因为我还不是 C++ 专家...我对 Java 更有经验。无论如何,我看到很多帖子都在谈论这些编译错误,即使是从 2005 年开始,但其中一些是只是扔掉,停止或其他有我无法完全理解的答案(我想直到现在它们不适合我的情况......)。

我可以在这里列出一些我试图找到答案的帖子:

  1. http://www.ogre3d.org/forums/viewtopic.php?p=205194
  2. 错误 C2039:“查找”:不是“标准”的成员
  3. 错误 C2039:“memchr”:不是“全局命名空间”的成员
  4. 编译 VS2008 解决方案时标准 Microsoft 文件“iosfwd”和“atlconv.h”中的语法错误?

我真的不知道我的程序出了什么问题,所以我在这里寻求帮助,因为我已经被困在这里 2 天阅读东西并试图解决我自己的问题,我不知道还能做什么走得更远。有人可以尝试向我解释编译可能有什么问题吗?

 1>------ Build started: Project: Almost giving up, Configuration: Debug Win32 ------
    1>  main.cpp
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(517): error C2039: 'memcmp' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(517): error C3861: 'memcmp': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(523): error C2039: 'strlen' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(523): error C3861: 'strlen': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(546): error C2039: 'memchr' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(546): error C3861: 'memchr': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(559): error C2039: 'memset' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(559): error C3861: 'memset': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2651): error C2039: 'memset' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2651): error C3861: 'memset': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2656): error C2039: 'memset' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2656): error C3861: 'memset': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2661): error C2039: 'memset' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2661): error C3861: 'memset': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2685): error C2039: 'memset' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2685): error C3861: 'memset': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2692): error C2039: 'memset' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2692): error C3861: 'memset': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2699): error C2039: 'memset' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2699): error C3861: 'memset': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2964): error C2039: 'memcmp' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2964): error C3861: 'memcmp': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2970): error C2039: 'memcmp' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2970): error C3861: 'memcmp': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2976): error C2039: 'memcmp' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2976): error C3861: 'memcmp': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3125): error C2039: 'memcmp' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3125): error C3861: 'memcmp': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3193): error C2039: 'memchr' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3193): error C3861: 'memchr': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3200): error C2039: 'memchr' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3200): error C3861: 'memchr': identifier not found
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3208): error C2039: 'memchr' : is not a member of '`global namespace''
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3208): error C3861: 'memchr': identifier not found
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(44): error C2146: syntax error : missing ';' before identifier 'utf8'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(44): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(46): error C2146: syntax error : missing ';' before identifier 'utf32'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(51): error C2146: syntax error : missing ';' before identifier 'encoded_char'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(51): error C2378: 'CEGUI::utf8' : redefinition; symbol cannot be overloaded with a typedef
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(44) : see declaration of 'CEGUI::utf8'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(64): error C2504: 'AllocatedObject' : base class undefined
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(64): error C2143: syntax error : missing ',' before '<'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(70): error C2146: syntax error : missing ';' before identifier 'value_type'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(70): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(87): error C2143: syntax error : missing ';' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(87): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(471): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(471): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(503): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(503): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(503): error C2535: 'CEGUI::String::String(const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(471) : see declaration of 'CEGUI::String::String'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(862): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(862): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(897): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(897): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(935): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(935): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(936): error C2535: 'int CEGUI::String::compare(CEGUI::String::size_type,CEGUI::String::size_type,const int) const' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(897) : see declaration of 'CEGUI::String::compare'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1082): error C2143: syntax error : missing ';' before '['
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1082): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1083): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1162): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1162): error C2143: syntax error : missing ';' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1163): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1165): warning C4183: 'data': missing return type; assumed to be a member function returning 'int'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1207): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1207): error C2061: syntax error : identifier 'utf8'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1430): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1430): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1430): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1431): error C2535: 'CEGUI::String &CEGUI::String::assign(const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404) : see declaration of 'CEGUI::String::assign'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1454): error C2535: 'CEGUI::String &CEGUI::String::operator =(const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381) : see declaration of 'CEGUI::String::operator ='
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1778): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1778): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1778): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1779): error C2535: 'CEGUI::String &CEGUI::String::append(const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751) : see declaration of 'CEGUI::String::append'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1807): error C2535: 'CEGUI::String &CEGUI::String::operator +=(const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728) : see declaration of 'CEGUI::String::operator +='
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2115): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2115): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2145): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2145): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2146): error C2535: 'CEGUI::String &CEGUI::String::insert(CEGUI::String::size_type,const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2115) : see declaration of 'CEGUI::String::insert'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2747): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2747): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2779): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2779): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2812): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2812): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2813): error C2535: 'CEGUI::String &CEGUI::String::replace(CEGUI::String::size_type,CEGUI::String::size_type,const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2747) : see declaration of 'CEGUI::String::replace'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2867): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2867): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2868): error C2535: 'CEGUI::String &CEGUI::String::replace(CEGUI::String::iterator,CEGUI::String::iterator,const int)' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2779) : see declaration of 'CEGUI::String::replace'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3445): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3445): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3445): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3446): error C2535: 'CEGUI::String::size_type CEGUI::String::find(const int) const' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388) : see declaration of 'CEGUI::String::find'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3496): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3496): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3497): error C2535: 'CEGUI::String::size_type CEGUI::String::rfind(const int) const' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415) : see declaration of 'CEGUI::String::rfind'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3877): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3877): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3877): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3878): error C2535: 'CEGUI::String::size_type CEGUI::String::find_first_of(const int) const' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820) : see declaration of 'CEGUI::String::find_first_of'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3925): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3925): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3925): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3926): error C2535: 'CEGUI::String::size_type CEGUI::String::find_first_not_of(const int) const' : member function already defined or declared
    1>          c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847) : see declaration of 'CEGUI::String::find_first_not_of'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4302): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4302): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4302): error C2143: syntax error : missing ',' before '*'
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4329): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
    1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4329): fatal error C1003: error count exceeds 100; stopping compilation
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skippe

d ==========

代码:

#include <RendererModules\Ogre\Renderer.h>

int main(){
// Bootstrap CEGUI::System with an OgreRenderer object that uses the
// default Ogre rendering window as the default output surface, an Ogre based
// ResourceProvider, and an Ogre based ImageCodec.
CEGUI::OgreRenderer& myRenderer =
CEGUI::OgreRenderer::bootstrapSystem();
}

代码来自http://www.cegui.org.uk/docs/current/rendering_tutorial.html;即使这并没有说明我已经尝试过包含xutilityiosfwd但错误是一样的,我也尝试从 VS 打开文件,但由于我不是专家,我无法完全理解检查任何错误,哪个我不敢相信这是错误的,因为它是默认文件..

4

1 回答 1

1

我知道这是一个旧帖子,但我想我会回答它。

如果您在 MSVC 包含目录中包含 cegui-0.8.7\cegui\include\CEGUI,那么它将在那里吸收 String.h 文件,然后将在任何地方使用该定义。因此,您开始看到诸如 xutility 和 iosfwd 之类的东西出现在污染中。

相反,您必须包含 ...\cegui-0.8.7\cegui\include 以便它在 CEGUI 范围内并且不会混淆您的整个构建系统。

希望这对某人有帮助!

于 2017-02-27T22:18:33.287 回答