2015-02-18 3 views
0

Привет У меня проблемы с компиляцией этого кода. У меня ошибка, и я не знаю, как это исправить. Я искал в Google, но ничего не нашел.Ошибка компиляции Visual studio 2013

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 
+0

Похоже, что вам не хватает включить. В режиме leas тип rights_t не известен компилятору. –

+0

@MartinSchlott как я могу это исправить? – raven

ответ

2

почти невозможно ответить на этот вопрос, не зная, весь проект. Наверное, вы скачали откуда-то. Ошибка, с которой вы сталкиваетесь, является симптомом, а не причиной. У компилятора, похоже, проблема с типом около editedHouseRights. Я думаю, это rights_t.

Если файл inlude отсутствовал, компилятор должен был бы выбросить ошибку непосредственно, как «Не удалось найти файл ...», но в этом случае это не так. При таком знании осталось только три ошибки.

  1. Вам не хватает библиотеки, которую проект ожидает на своем месте. Прочтите руководство по установке. Вы можете что-то потерять.
  2. В коде используются переключатели #ifdef. Возможно, вы забыли установить правильную #define. Это также можно найти в документации.
  3. Часть необходимых компонентов должна быть установлена ​​глобально в настройках проекта. Прочтите руководство для этого.

В конце концов, это не ошибка кода, это проблема проекта, связанная с проектом. Спросите кого-нибудь из проекта.

Смежные вопросы