Secretchronicles / TSC

An open source two-dimensional platform game.
https://secretchronicles.org/
GNU General Public License v3.0
205 stars 49 forks source link

error: ‘class TSC::cLevel_Player’ has no member named ‘m_points’ #638

Closed jpenguin closed 6 years ago

jpenguin commented 6 years ago

Building 'devel' branch on Fedora 28, my setup is documented here https://github.com/jpenguin/TSC/blob/devel/INSTALL.md

home/jpenguin/build/TSC/tsc/src/gui/menu_data.cpp: In member function ‘bool TSC::cMenu_Options::Joystick_Name_Click(const CEGUI::EventArgs&)’:
/home/jpenguin/build/TSC/tsc/src/gui/menu_data.cpp:2870:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
     if (selected_item >= pJoystick->m_num_joysticks) {
         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jpenguin/build/TSC/tsc/src/gui/menu_data.cpp: In member function ‘bool TSC::cMenu_Savegames::Button_Save_Clicked(const CEGUI::EventArgs&)’:
/home/jpenguin/build/TSC/tsc/src/gui/menu_data.cpp:3230:43: error: ‘class TSC::cLevel_Player’ has no member named ‘m_points’; did you mean ‘m_pos_x’?
         gp_hud->Set_Points(pLevel_Player->m_points - 3000);
                                           ^~~~~~~~
                                           m_pos_x
/home/jpenguin/build/TSC/tsc/src/gui/menu_data.cpp: In member function ‘std::__cxx11::string TSC::cMenu_Savegames::Set_Save_Description(unsigned int)’:
/home/jpenguin/build/TSC/tsc/src/gui/menu_data.cpp:3276:54: error: ‘class TSC::cLevel_Player’ has no member named ‘m_points’; did you mean ‘m_pos_x’?
     if (pActive_Level->Is_Loaded() && pLevel_Player->m_points < 3000) {
                                                      ^~~~~~~~
                                                      m_pos_x
make[2]: *** [CMakeFiles/tsc.dir/build.make:692: CMakeFiles/tsc.dir/src/gui/menu_data.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:212: CMakeFiles/tsc.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
refi64 commented 6 years ago

I have a fix for this in my local repo. Basically, as a temporary workaround, try building with -DCMAKE_BUILD_TYPE=Debug.

Quintus commented 6 years ago

Ah thanks kirbyfan. This was my bad. When I removed the duplicate point storage, I only compiled with debug mode enabled for obvious reasons. I should have tested a release build.

Thanks for fixing.