jakowskidev / uMario_Jakowski

uMario C++/SDL2 Game by Łykasz Jakowski
GNU General Public License v2.0
791 stars 248 forks source link

error C2065: 'M_PI': undeclared identifier #19

Open liudonghua123 opened 2 years ago

liudonghua123 commented 2 years ago

I tried to build it on windows according to the readme. But during the build process, I saw the error D:\code\c_cpp\uMario_Jakowski\uNext\FireBall.cpp(21,20): error C2065: 'M_PI': undeclared identifier [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj].

mkdir build
cd build
# install sdl dependences using vcpkg
vcpkg install sdl2 sdl2:x64-windows
vcpkg install sdl2-image sdl2-image:x64-windows
vcpkg install sdl2-mixer sdl2-mixer:x64-windows
cmake ..  -DCMAKE_TOOLCHAIN_FILE=D:/apps/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release
logs ```shell D:\code\c_cpp\uMario_Jakowski\build>cmake .. -DCMAKE_TOOLCHAIN_FILE=D:/apps/vcpkg/scripts/buildsystems/vcpk g.cmake -- Building for: Visual Studio 17 2022 CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000. -- The C compiler identification is MSVC 19.31.31105.0 -- The CXX compiler identification is MSVC 19.31.31105.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning (dev) at CMakeLists.txt:13 (elseif): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. Run "cmake --help-policy CMP0054" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Quoted variables like "MSVC" will no longer be dereferenced when the policy is set to NEW. Since the policy is not set the OLD behavior will be used. This warning is for project developers. Use -Wno-dev to suppress it. -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE -- Found SDL2: D:/apps/vcpkg/installed/x64-windows/lib/manual-link/SDL2main.lib;D:/apps/vcpkg/installed/x64-windows/lib/SDL2.lib CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to `find_package_handle_standard_args` (SDL2_image) does not match the name of the calling package (SDL2_Image). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): cmake/FindSDL2_Image.cmake:89 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) D:/apps/vcpkg/scripts/buildsystems/vcpkg.cmake:816 (_find_package) CMakeLists.txt:22 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. -- Found SDL2_image: D:/apps/vcpkg/installed/x64-windows/debug/lib/SDL2_image.lib (found version "..") CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to `find_package_handle_standard_args` (SDL2_mixer) does not match the name of the calling package (SDL2_Mixer). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): cmake/FindSDL2_Mixer.cmake:89 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) D:/apps/vcpkg/scripts/buildsystems/vcpkg.cmake:816 (_find_package) CMakeLists.txt:23 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. -- Found SDL2_mixer: D:/apps/vcpkg/installed/x64-windows/debug/lib/SDL2_mixer.lib (found version "..") -- Configuring done -- Generating done -- Build files have been written to: D:/code/c_cpp/uMario_Jakowski/build D:\code\c_cpp\uMario_Jakowski\build>cmake --build . --config Release Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved. Checking Build System Building Custom Rule D:/code/c_cpp/uMario_Jakowski/CMakeLists.txt AboutMenu.cpp D:\code\c_cpp\uMario_Jakowski\uNext\AboutMenu.cpp(12,37): warning C4267: '=': conversion from 'size_t' to 'int', possib le loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\AboutMenu.cpp(224,37): warning C4244: 'argument': conversion from 'int' to 'Uint8', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\AboutMenu.cpp(224,33): warning C4244: 'argument': conversion from 'int' to 'Uint8', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\AboutMenu.cpp(224,29): warning C4244: 'argument': conversion from 'int' to 'Uint8', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Beetle.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Beetle.cpp(96,46): warning C4458: declaration of 'minionState' hides class member [ D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] Block.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Block.cpp(32,38): warning C4458: declaration of 'iBlockID' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Block.h(16,6): message : see declaration of 'Block::iBlockID' [D:\code\c_cpp\uMario _Jakowski\build\uMario.vcxproj] BlockDebris.cpp Bowser.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Bowser.cpp(157,39): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_ cpp\uMario_Jakowski\build\uMario.vcxproj] Bubble.cpp BulletBill.cpp D:\code\c_cpp\uMario_Jakowski\uNext\BulletBill.cpp(6,51): warning C4100: 'moveDirection': unreferenced formal parameter [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] BulletBillSpawner.cpp CFG.cpp D:\code\c_cpp\uMario_Jakowski\uNext\CFG.cpp(54,44): warning C4244: 'argument': conversion from 'int' to 'const _Elem', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] with [ _Elem=char ] D:\code\c_cpp\uMario_Jakowski\uNext\CFG.cpp(58,44): warning C4244: 'argument': conversion from 'int' to 'const _Elem', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] with [ _Elem=char ] Cheep.cpp CheepSpawner.cpp Coin.cpp Console.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Console.cpp(30,3): warning C4267: 'initializing': conversion from 'size_t' to 'int' , possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Core.cpp Event.cpp Fire.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Fire.cpp(52,37): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] FireBall.cpp D:\code\c_cpp\uMario_Jakowski\uNext\FireBall.cpp(21,20): error C2065: 'M_PI': undeclared identifier [D:\code\c_cpp\uMar io_Jakowski\build\uMario.vcxproj] Flag.cpp Flower.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Flower.cpp(59,39): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_c pp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Flower.cpp(66,46): warning C4458: declaration of 'minionState' hides class member [ D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Flower.cpp(66,33): warning C4100: 'minionState': unreferenced formal parameter [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Goombas.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Goombas.cpp(60,47): warning C4458: declaration of 'minionState' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] Generating Code... Compiling... Hammer.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Hammer.cpp(76,39): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_c pp\uMario_Jakowski\build\uMario.vcxproj] HammerBro.cpp IMG.cpp D:\code\c_cpp\uMario_Jakowski\uNext\IMG.cpp(42,67): warning C4458: declaration of 'rRect' hides class member [D:\code\c _cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\IMG.h(12,11): message : see declaration of 'CIMG::rRect' [D:\code\c_cpp\uMario_Jako wski\build\uMario.vcxproj] Koppa.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Koppa.cpp(227,45): warning C4458: declaration of 'minionState' hides class member [ D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] Lakito.cpp LevelEditor.cpp LevelText.cpp D:\code\c_cpp\uMario_Jakowski\uNext\LevelText.cpp(25,44): warning C4458: declaration of 'sText' hides class member [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\LevelText.h(14,14): message : see declaration of 'LevelText::sText' [D:\code\c_cpp\ uMario_Jakowski\build\uMario.vcxproj] LoadingMenu.cpp MainMenu.cpp D:\code\c_cpp\uMario_Jakowski\uNext\MainMenu.cpp(12,37): warning C4267: '=': conversion from 'size_t' to 'int', possibl e loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Map.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(137,3): warning C4267: 'initializing': conversion from 'size_t' to 'int', p ossible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(146,3): warning C4267: 'initializing': conversion from 'size_t' to 'int', p ossible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(151,31): warning C4267: '=': conversion from 'size_t' to 'int', possible lo ss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(158,31): warning C4267: '=': conversion from 'size_t' to 'int', possible lo ss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(293,4): warning C4267: 'initializing': conversion from 'size_t' to 'unsigne d int', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(420,3): warning C4267: 'initializing': conversion from 'size_t' to 'int', p ossible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(489,31): warning C4100: 'nY': unreferenced formal parameter [D:\code\c_cpp\ uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(723,2): warning C4267: 'initializing': conversion from 'size_t' to 'int', p ossible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(724,29): warning C4267: '+=': conversion from 'size_t' to 'int', possible l oss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(2382,28): warning C4267: '=': conversion from 'size_t' to 'int', possible l oss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(2383,30): warning C4267: '=': conversion from 'size_t' to 'int', possible l oss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(2411,3): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(2413,29): warning C4267: '=': conversion from 'size_t' to 'int', possible l oss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(3412,34): warning C4267: '=': conversion from 'size_t' to 'int', possible l oss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(3419,3): warning C4456: declaration of 'i' hides previous local declaration [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(3417,10): message : see declaration of 'i' [D:\code\c_cpp\uMario_Jakowski\b uild\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(9793,41): warning C4100: 'iBlockID': unreferenced formal parameter [D:\code \c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10278,40): warning C4458: declaration of 'iLevelType' hides class member [D :\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(72,6): message : see declaration of 'Map::iLevelType' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10286,49): warning C4458: declaration of 'currentLevelID' hides class membe r [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(71,6): message : see declaration of 'Map::currentLevelID' [D:\code\c_cpp\uMar io_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10301,42): warning C4458: declaration of 'underWater' hides class member [D :\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(73,7): message : see declaration of 'Map::underWater' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10305,46): warning C4458: declaration of 'iSpawnPointID' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(75,6): message : see declaration of 'Map::iSpawnPointID' [D:\code\c_cpp\uMari o_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10313,36): warning C4458: declaration of 'iMapTime' hides class member [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(80,6): message : see declaration of 'Map::iMapTime' [D:\code\c_cpp\uMario_Jak owski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10325,37): warning C4458: declaration of 'bMoveMap' hides class member [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(77,7): message : see declaration of 'Map::bMoveMap' [D:\code\c_cpp\uMario_Jak owski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10333,40): warning C4458: declaration of 'drawLines' hides class member [D: \code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(112,7): message : see declaration of 'Map::drawLines' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(10347,36): warning C4458: declaration of 'inEvent' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Map.h(82,7): message : see declaration of 'Map::inEvent' [D:\code\c_cpp\uMario_Jako wski\build\uMario.vcxproj] MapLevel.cpp D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.cpp(73,41): warning C4458: declaration of 'iBlockID' hides class member [D :\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.h(9,6): message : see declaration of 'MapLevel::iBlockID' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.cpp(85,43): warning C4458: declaration of 'iNumOfUse' hides class member [ D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.h(14,6): message : see declaration of 'MapLevel::iNumOfUse' [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.cpp(93,53): warning C4458: declaration of 'spawnMushroom' hides class memb er [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.h(11,7): message : see declaration of 'MapLevel::spawnMushroom' [D:\code\c _cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.cpp(101,41): warning C4458: declaration of 'powerUP' hides class member [D :\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.h(12,7): message : see declaration of 'MapLevel::powerUP' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.cpp(109,45): warning C4458: declaration of 'spawnStar' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MapLevel.h(13,7): message : see declaration of 'MapLevel::spawnStar' [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] Menu.cpp MenuManager.cpp MenuOption.cpp D:\code\c_cpp\uMario_Jakowski\uNext\MenuOption.cpp(22,45): warning C4458: declaration of 'sText' hides class member [D: \code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\MenuOption.h(11,14): message : see declaration of 'MenuOption::sText' [D:\code\c_cp p\uMario_Jakowski\build\uMario.vcxproj] Minion.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Minion.cpp(37,43): warning C4100: 'iIMG': unreferenced formal parameter [D:\code\c_ cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.cpp(37,33): warning C4100: 'rR': unreferenced formal parameter [D:\code\c_cp p\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.cpp(150,39): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_ cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.cpp(201,39): warning C4458: declaration of 'iBlockID' hides class member [D: \code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(20,6): message : see declaration of 'Minion::iBlockID' [D:\code\c_cpp\uMar io_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.cpp(221,46): warning C4458: declaration of 'minionState' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] Mushroom.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Mushroom.cpp(68,41): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c _cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Mushroom.cpp(81,48): warning C4458: declaration of 'minionState' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Mushroom.cpp(81,35): warning C4100: 'minionState': unreferenced formal parameter [D :\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Music.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Music.cpp(173,36): warning C4458: declaration of 'iVolume' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Music.h(16,6): message : see declaration of 'Music::iVolume' [D:\code\c_cpp\uMario_ Jakowski\build\uMario.vcxproj] MusicManager.cpp OptionsMenu.cpp D:\code\c_cpp\uMario_Jakowski\uNext\OptionsMenu.cpp(22,37): warning C4267: '=': conversion from 'size_t' to 'int', poss ible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\OptionsMenu.cpp(73,8): warning C4389: '==': signed/unsigned mismatch [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\OptionsMenu.cpp(234,62): warning C4458: declaration of 'escapeToMainMenu' hides cla ss member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\OptionsMenu.h(18,7): message : see declaration of 'OptionsMenu::escapeToMainMenu' [ D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] PauseMenu.cpp D:\code\c_cpp\uMario_Jakowski\uNext\PauseMenu.cpp(19,37): warning C4267: '=': conversion from 'size_t' to 'int', possib le loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\PauseMenu.cpp(48,8): warning C4389: '==': signed/unsigned mismatch [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] Generating Code... D:\code\c_cpp\uMario_Jakowski\uNext\Map.cpp(620): warning C4701: potentially uninitialized local variable 'tempBlock' u sed [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Compiling... Pipe.cpp Plant.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Plant.cpp(83,38): warning C4100: 'onTOP': unreferenced formal parameter [D:\code\c_ cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Plant.cpp(107,45): warning C4458: declaration of 'minionState' hides class member [ D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] Platform.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Platform.cpp(219,37): warning C4458: declaration of 'iType' hides class member [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Platform.h(12,6): message : see declaration of 'Platform::iType' [D:\code\c_cpp\uMa rio_Jakowski\build\uMario.vcxproj] Player.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1075,51): warning C4458: declaration of 'moveDirection' hides class memb er [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(49,7): message : see declaration of 'Player::moveDirection' [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1094,57): warning C4458: declaration of 'inLevelAnimation' hides class m ember [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(41,7): message : see declaration of 'Player::inLevelAnimation' [D:\code\c_ cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1102,35): warning C4458: declaration of 'fXPos' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(20,8): message : see declaration of 'Player::fXPos' [D:\code\c_cpp\uMario_ Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1114,40): warning C4458: declaration of 'powerLVL' hides class member [D :\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(39,6): message : see declaration of 'Player::powerLVL' [D:\code\c_cpp\uMar io_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1154,45): warning C4458: declaration of 'starEffect' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(24,7): message : see declaration of 'Player::starEffect' [D:\code\c_cpp\uM ario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1170,45): warning C4458: declaration of 'iNumOfLives' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(21,6): message : see declaration of 'Player::iNumOfLives' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1190,54): warning C4458: declaration of 'nextFallFrameID' hides class me mber [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(81,6): message : see declaration of 'Player::nextFallFrameID' [D:\code\c_c pp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1194,58): warning C4458: declaration of 'currentJumpSpeed' hides class m ember [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(69,8): message : see declaration of 'Player::currentJumpSpeed' [D:\code\c_ cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1198,42): warning C4458: declaration of 'moveSpeed' hides class member [ D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(56,6): message : see declaration of 'Player::moveSpeed' [D:\code\c_cpp\uMa rio_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1202,35): warning C4458: declaration of 'fYPos' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(20,15): message : see declaration of 'Player::fYPos' [D:\code\c_cpp\uMario _Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1210,36): warning C4458: declaration of 'bSquat' hides class member [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(59,7): message : see declaration of 'Player::bSquat' [D:\code\c_cpp\uMario _Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1224,45): warning C4458: declaration of 'springJump' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(75,7): message : see declaration of 'Player::springJump' [D:\code\c_cpp\uM ario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1232,44): warning C4458: declaration of 'iScore' hides class member [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(32,15): message : see declaration of 'Player::iScore' [D:\code\c_cpp\uMari o_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.cpp(1249,44): warning C4458: declaration of 'iCoins' hides class member [D:\ code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Player.h(33,15): message : see declaration of 'Player::iCoins' [D:\code\c_cpp\uMari o_Jakowski\build\uMario.vcxproj] PlayerFireBall.cpp D:\code\c_cpp\uMario_Jakowski\uNext\PlayerFireBall.cpp(123,47): warning C4100: 'TOP': unreferenced formal parameter [D: \code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\PlayerFireBall.cpp(134,54): warning C4458: declaration of 'minionState' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\PlayerFireBall.cpp(134,41): warning C4100: 'minionState': unreferenced formal param eter [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Points.cpp Spikey.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Spikey.cpp(63,39): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_c pp\uMario_Jakowski\build\uMario.vcxproj] Spring.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Spring.cpp(100,46): warning C4458: declaration of 'minionState' hides class member [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Spring.cpp(100,33): warning C4100: 'minionState': unreferenced formal parameter [D: \code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Sprite.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Sprite.cpp(13,38): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Squid.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Squid.cpp(76,38): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_cp p\uMario_Jakowski\build\uMario.vcxproj] Star.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Star.cpp(93,37): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Star.cpp(100,44): warning C4458: declaration of 'minionState' hides class member [D :\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Star.cpp(100,31): warning C4100: 'minionState': unreferenced formal parameter [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Text.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(28,82): warning C4458: declaration of 'fontSize' hides class member [D:\co de\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.h(17,6): message : see declaration of 'Text::fontSize' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(46,106): warning C4458: declaration of 'fontSize' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.h(17,6): message : see declaration of 'Text::fontSize' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(52,50): warning C4244: 'argument': conversion from 'int' to 'Uint8', possi ble loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(52,46): warning C4244: 'argument': conversion from 'int' to 'Uint8', possi ble loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(52,42): warning C4244: 'argument': conversion from 'int' to 'Uint8', possi ble loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(66,106): warning C4458: declaration of 'fontSize' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.h(17,6): message : see declaration of 'Text::fontSize' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(85,107): warning C4458: declaration of 'fontSize' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.h(17,6): message : see declaration of 'Text::fontSize' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(85,89): warning C4100: 'iB': unreferenced formal parameter [D:\code\c_cpp\ uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(85,81): warning C4100: 'iG': unreferenced formal parameter [D:\code\c_cpp\ uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(85,73): warning C4100: 'iR': unreferenced formal parameter [D:\code\c_cpp\ uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(110,57): warning C4458: declaration of 'fontSize' hides class member [D:\c ode\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.h(17,6): message : see declaration of 'Text::fontSize' [D:\code\c_cpp\uMario_J akowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Text.cpp(111,39): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Texture.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Texture.cpp(21,37): warning C4100: 'offsetY': unreferenced formal parameter [D:\cod e\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Texture.cpp(21,24): warning C4100: 'offsetX': unreferenced formal parameter [D:\cod e\c_cpp\uMario_Jakowski\build\uMario.vcxproj] Toad.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Toad.cpp(35,37): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Toad.cpp(37,44): warning C4458: declaration of 'minionState' hides class member [D: \code\c_cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Minion.h(16,6): message : see declaration of 'Minion::minionState' [D:\code\c_cpp\u Mario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Toad.cpp(37,31): warning C4100: 'minionState': unreferenced formal parameter [D:\co de\c_cpp\uMario_Jakowski\build\uMario.vcxproj] UpFire.cpp D:\code\c_cpp\uMario_Jakowski\uNext\UpFire.cpp(90,39): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_c pp\uMario_Jakowski\build\uMario.vcxproj] Vector2.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Vector2.cpp(20,27): warning C4458: declaration of 'X' hides class member [D:\code\c _cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Vector2.h(9,6): message : see declaration of 'Vector2::X' [D:\code\c_cpp\uMario_Jak owski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Vector2.cpp(28,27): warning C4458: declaration of 'Y' hides class member [D:\code\c _cpp\uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\Vector2.h(9,9): message : see declaration of 'Vector2::Y' [D:\code\c_cpp\uMario_Jak owski\build\uMario.vcxproj] Vine.cpp D:\code\c_cpp\uMario_Jakowski\uNext\Vine.cpp(65,37): warning C4100: 'TOP': unreferenced formal parameter [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] main.cpp D:\code\c_cpp\uMario_Jakowski\uNext\main.cpp(4,26): warning C4100: 'argv': unreferenced formal parameter [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] D:\code\c_cpp\uMario_Jakowski\uNext\main.cpp(4,14): warning C4100: 'argc': unreferenced formal parameter [D:\code\c_cpp \uMario_Jakowski\build\uMario.vcxproj] Generating Code... D:\code\c_cpp\uMario_Jakowski\build> ```
liudonghua123 commented 2 years ago

I found this link https://stackoverflow.com/questions/26065359/m-pi-flagged-as-undeclared-identifier.

So I added the following code to FireBall.cpp:5, then I can build successfully.

#ifdef _WIN32
#include <corecrt_math_defines.h>
#endif

updated: use the following maybe better.

#if defined(_WIN32) || defined(WIN32) 
#include <corecrt_math_defines.h>
#endif
liudonghua123 commented 2 years ago

I write a simple pr https://github.com/jakowskidev/uMario_Jakowski/pull/20.