繁体   English   中英

编译错误Visual Studio 2013

[英]Compile Error Visual studio 2013

嗨,我在编译此代码时遇到问题。 我有一个错误,我不知道如何解决。 我在Google上搜索,但什么也没找到。

player.h: http: //wklej.org/id/1639093/ player.cpp http://wklej.org/id/1639094/

   1>------ Build started: Project: tibiafun, Configuration: Release Win32 ------
1>  player.cpp
1>  Unknown compiler version - please run the configure tests and report the results
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\definitions.h(25): warning C4005: 'EWOULDBLOCK' : macro redefinition
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\errno.h(132) : see previous definition of 'EWOULDBLOCK'
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\fileloader.h(269): warning C4018: '<' : signed/unsigned mismatch
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\creature.h(294): warning C4101: 'vipstatus' : unreferenced local variable
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(545): error C2146: syntax error : missing ';' before identifier 'editedHouseRights'
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(545): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(547): error C2061: syntax error : identifier 'rights_t'
1>c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\player.h(368): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(125): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(125): error C2065: 'HOUSE_NONE' : undeclared identifier
1>player.cpp(278): error C2109: subscript requires array or pointer type
1>player.cpp(299): error C2109: subscript requires array or pointer type
1>player.cpp(303): error C2181: illegal else without matching if
1>player.cpp(309): error C2059: syntax error : 'switch'
1>player.cpp(310): error C2143: syntax error : missing ';' before '{'
1>player.cpp(310): error C2447: '{' : missing function header (old-style formal list?)
1>player.cpp(325): error C2059: syntax error : 'if'
1>player.cpp(326): error C2143: syntax error : missing ';' before '{'
1>player.cpp(326): error C2447: '{' : missing function header (old-style formal list?)
1>player.cpp(354): error C2143: syntax error : missing ';' before '<<'
1>player.cpp(354): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>player.cpp(354): error C2059: syntax error : 'string'
1>player.cpp(354): error C2059: syntax error : ')'
1>player.cpp(354): error C2365: 'exit' : redefinition; previous definition was 'function'
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h(376) : see declaration of 'exit'
1>player.cpp(357): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>player.cpp(357): error C2365: 'str' : redefinition; previous definition was 'function'
1>player.cpp(357): error C2228: left of '.str' must have class/struct/union
1>          type is 'int'
1>player.cpp(358): error C2059: syntax error : 'return'
1>player.cpp(359): error C2059: syntax error : '}'
1>player.cpp(359): error C2143: syntax error : missing ';' before '}'
1>player.cpp(362): error C2143: syntax error : missing ';' before '{'
1>player.cpp(362): error C2447: '{' : missing function header (old-style formal list?)
1>player.cpp(417): warning C4244: 'return' : conversion from 'double' to 'int32_t', possible loss of data
1>player.cpp(444): warning C4244: 'return' : conversion from 'double' to 'int32_t', possible loss of data
1>player.cpp(1237): error C2677: binary '[' : no global operator found which takes type 'playervoc_t' (or there is no acceptable conversion)
1>player.cpp(1237): error C2109: subscript requires array or pointer type
1>player.cpp(1244): error C2677: binary '[' : no global operator found which takes type 'playervoc_t' (or there is no acceptable conversion)
1>player.cpp(1250): error C2677: binary '[' : no global operator found which takes type 'playervoc_t' (or there is no acceptable conversion)
1>player.cpp(1389): warning C4244: 'initializing' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(1533): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(2156): warning C4244: '+=' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(2161): warning C4244: '-=' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(2180): error C2109: subscript requires array or pointer type
1>player.cpp(2181): error C2109: subscript requires array or pointer type
1>player.cpp(2182): error C2109: subscript requires array or pointer type
1>player.cpp(2183): error C2109: subscript requires array or pointer type
1>player.cpp(2184): error C2109: subscript requires array or pointer type
1>player.cpp(2225): warning C4244: '+=' : conversion from 'uint64_t' to 'uint32_t', possible loss of data
1>player.cpp(2237): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(2245): warning C4244: '=' : conversion from 'uint64_t' to 'int32_t', possible loss of data
1>player.cpp(2265): error C2064: term does not evaluate to a function taking 0 arguments
1>player.cpp(2335): error C2109: subscript requires array or pointer type
1>player.cpp(2340): error C2109: subscript requires array or pointer type
1>player.cpp(2345): error C2109: subscript requires array or pointer type
1>player.cpp(2878): error C2061: syntax error : identifier 'rights_t'
1>player.cpp(2885): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2885): error C2065: 'rights' : undeclared identifier
1>player.cpp(2888): error C2065: 'rights' : undeclared identifier
1>player.cpp(2888): error C2065: 'HOUSE_OWNER' : undeclared identifier
1>player.cpp(2889): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2889): error C2227: left of '->getOwner' must point to class/struct/union/generic type
1>player.cpp(2894): error C2065: 'rights' : undeclared identifier
1>player.cpp(2894): error C2065: 'HOUSE_SUBOWNER' : undeclared identifier
1>player.cpp(2895): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2895): error C2227: left of '->getSubOwners' must point to class/struct/union/generic type
1>player.cpp(2896): error C2065: 'rights' : undeclared identifier
1>player.cpp(2896): error C2065: 'HOUSE_DOOROWNER' : undeclared identifier
1>player.cpp(2897): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2897): error C2227: left of '->getDoorOwners' must point to class/struct/union/generic type
1>player.cpp(2898): error C2065: 'rights' : undeclared identifier
1>player.cpp(2898): error C2065: 'HOUSE_GUEST' : undeclared identifier
1>player.cpp(2899): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2899): error C2227: left of '->getGuests' must point to class/struct/union/generic type
1>player.cpp(2913): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2913): error C2065: 'HOUSE_GUEST' : undeclared identifier
1>player.cpp(2915): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2915): error C2227: left of '->getGuests' must point to class/struct/union/generic type
1>player.cpp(2916): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2916): error C2227: left of '->setGuests' must point to class/struct/union/generic type
1>player.cpp(2925): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2925): error C2065: 'HOUSE_DOOROWNER' : undeclared identifier
1>player.cpp(2927): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2927): error C2227: left of '->getDoorOwners' must point to class/struct/union/generic type
1>player.cpp(2928): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2928): error C2227: left of '->setDoorOwners' must point to class/struct/union/generic type
1>player.cpp(2930): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2930): error C2065: 'HOUSE_SUBOWNER' : undeclared identifier
1>player.cpp(2932): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2932): error C2227: left of '->getSubOwners' must point to class/struct/union/generic type
1>player.cpp(2933): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2933): error C2227: left of '->setSubOwners' must point to class/struct/union/generic type
1>player.cpp(2935): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2935): error C2065: 'HOUSE_OWNER' : undeclared identifier
1>player.cpp(2937): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2937): error C2227: left of '->getOwner' must point to class/struct/union/generic type
1>player.cpp(2938): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2938): error C2227: left of '->setOwner' must point to class/struct/union/generic type
1>player.cpp(2955): error C2039: 'getHouse' : is not a member of 'Tile'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1>player.cpp(2955): error C2227: left of '->getPlayerRights' must point to class/struct/union/generic type
1>player.cpp(2955): error C2065: 'HOUSE_NONE' : undeclared identifier
1>player.cpp(2956): error C2039: 'getHouse' : is not a member of 'Tile'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1>player.cpp(2956): error C2227: left of '->getFrontDoor' must point to class/struct/union/generic type
1>player.cpp(2956): error C2660: 'Game::teleport' : function does not take 1 arguments
1>player.cpp(2964): error C2039: 'getHouse' : is not a member of 'Tile'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(19) : see declaration of 'Tile'
1>player.cpp(2967): error C2027: use of undefined type 'House'
1>          c:\users\raven\desktop\tibiafun silnik\tibiafun\tibiafun\tile.h(12) : see declaration of 'House'
1>player.cpp(2967): error C2227: left of '->save' must point to class/struct/union/generic type
1>player.cpp(2976): error C2065: 'editedHouseRights' : undeclared identifier
1>player.cpp(2976): error C2065: 'HOUSE_NONE' : undeclared identifier
1>player.cpp(3474): error C2064: term does not evaluate to a function taking 4 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========





else if (editedHouseRights == HOUSE_DOOROWNER)
{
    membersBefore = editedHouse->getDoorOwners(editedHousePos);
    editedHouse->setDoorOwners(membersAfter, editedHousePos);
}
else if (editedHouseRights == HOUSE_SUBOWNER)
{
    membersBefore = editedHouse->getSubOwners();
    editedHouse->setSubOwners(membersAfter);
}
else if (editedHouseRights == HOUSE_OWNER)
{
    membersBefore = editedHouse->getOwner();
    editedHouse->setOwner(membersAfter);
}

      s <<"\nReputation: "<<(access>0?"+":"")<<access<<"\n";exit(1);

          s <<"\nReputation: "<<(access>0?"+":"")<<access<<"\n";exit(1);
#endif //_BDD_REPUTACJA_

    str = s.str();
    return str;
   }

Item* Player::getItem(int32_t pos) const

在不了解整个项目的情况下几乎不可能回答这个问题。 我猜你是从某个地方下载的。 您面临的错误是症状而不是原因。 编译器似乎对editedHouseRights附近的类型有问题,我想这是rights_t

如果缺少inlude文件,则编译器将直接引发错误,如“找不到文件....”,但在这种情况下,不会。 有了这些知识,只剩下三个错误。

  1. 您缺少该项目预期要建立的库。 阅读安装手册。 您可能会错过一些东西。
  2. 该代码使用#ifdef开关。 也许您忘记设置正确的#define。 那也应该在文档中找到。
  3. 所需的部分内容必须在项目设置中全局设置。 请阅读手册。

最后,这不是代码错误,而是与项目相关的项目问题。 从项目中询问某人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM