Im getting these errors, what do they mean? its DEFINITELY not my code because it works when i compile it in codeblocks but not in microsoft visual c++ 2008.

1>------ Build started: Project: DropBlock, Configuration: Debug Win32 ------
1>  player.cpp
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): error C2065: 'blocks' : undeclared identifier
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): error C2228: left of '.push_back' must have class/struct/union
1>          type is ''unknown-type''
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): error C2440: '<function-style-cast>' : cannot convert from 'SDL_Rect' to 'BLOCK'
1>          No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(72): warning C4244: '+=' : conversion from 'double' to 'Sint16', possible loss of data
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(82): warning C4244: '-=' : conversion from 'double' to 'Sint16', possible loss of data
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(86): warning C4244: '+=' : conversion from 'double' to 'Sint16', possible loss of data
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(96): warning C4244: '-=' : conversion from 'double' to 'Sint16', possible loss of data
1>  main.cpp
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): error C2065: 'blocks' : undeclared identifier
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): error C2228: left of '.push_back' must have class/struct/union
1>          type is ''unknown-type''
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(43): error C2440: '<function-style-cast>' : cannot convert from 'SDL_Rect' to 'BLOCK'
1>          No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(72): warning C4244: '+=' : conversion from 'double' to 'Sint16', possible loss of data
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(82): warning C4244: '-=' : conversion from 'double' to 'Sint16', possible loss of data
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(86): warning C4244: '+=' : conversion from 'double' to 'Sint16', possible loss of data
1>c:\users\chris\desktop\c++\-zcomplete game\backup\player.cpp(96): warning C4244: '-=' : conversion from 'double' to 'Sint16', possible loss of data
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Either you have not included all the necessary header files or you have used codeblocks specific code.

Why does the compilation of "main.cpp" trigger error reports coming from "player.cpp"? You are not #includeing "player.cpp" from your "main.cpp" file, are you?

This has to be coming from an undeclared type or variable. The real error is at "player.cpp" at line 43, the rest is just noise from the compiler.

Please post the relevant code for us to help you further.

This article has been dead for over six months. Start a new discussion instead.