JoseTomasTocino / freegemas

Freegemas is an open source version of the well known Bejeweled, built in C++ using SDL2
GNU General Public License v2.0
61 stars 18 forks source link

Build error #2

Closed yochananmarqos closed 5 years ago

yochananmarqos commented 6 years ago

I get the following error building on Manjaro whether I attempt to use the AUR package or build it myself:

[yochanan@EEE-Book freegemas]$ mkdir build
[yochanan@EEE-Book freegemas]$ cd build
[yochanan@EEE-Book build]$ cmake ..
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for one of the modules 'sdl2'
-- Checking for one of the modules 'SDL2_image>=2.0.0'
-- Checking for one of the modules 'SDL2_ttf>=2.0.0'
-- Checking for one of the modules 'SDL2_mixer>=2.0.0'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yochanan/freegemas/build
[yochanan@EEE-Book build]$ make
Scanning dependencies of target link_media_folder
[  0%] Built target link_media_folder
Scanning dependencies of target freegemas
[  4%] Building CXX object CMakeFiles/freegemas.dir/src/Animation.cpp.o
[  8%] Building CXX object CMakeFiles/freegemas.dir/src/BaseButton.cpp.o
[ 13%] Building CXX object CMakeFiles/freegemas.dir/src/Board.cpp.o
[ 17%] Building CXX object CMakeFiles/freegemas.dir/src/Ecuaciones.cpp.o
[ 21%] Building CXX object CMakeFiles/freegemas.dir/src/Game.cpp.o
[ 26%] Building CXX object CMakeFiles/freegemas.dir/src/GameBoard.cpp.o
/home/yochanan/freegemas/src/GameBoard.cpp:6:22: error: ‘placeholders’ is not a namespace-name
 using namespace std::placeholders;
                      ^~~~~~~~~~~~
/home/yochanan/freegemas/src/GameBoard.cpp:6:34: error: expected namespace-name before ‘;’ token
 using namespace std::placeholders;
                                  ^
/home/yochanan/freegemas/src/GameBoard.cpp: In member function ‘void GameBoard::update()’:
/home/yochanan/freegemas/src/GameBoard.cpp:258:25: error: ‘bind’ is not a member of ‘std’
                    std::bind<bool>(&FloatingScore::ended, _1)),
                         ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:258:25: note: suggested alternative: ‘find’
                    std::bind<bool>(&FloatingScore::ended, _1)),
                         ^~~~
                         find
/home/yochanan/freegemas/src/GameBoard.cpp:258:30: error: expected primary-expression before ‘bool’
                    std::bind<bool>(&FloatingScore::ended, _1)),
                              ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:265:25: error: ‘bind’ is not a member of ‘std’
                    std::bind<bool>(&ParticleSystem::ended, _1)),
                         ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:265:25: note: suggested alternative: ‘find’
                    std::bind<bool>(&ParticleSystem::ended, _1)),
                         ^~~~
                         find
/home/yochanan/freegemas/src/GameBoard.cpp:265:30: error: expected primary-expression before ‘bool’
                    std::bind<bool>(&ParticleSystem::ended, _1)),
                              ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp: In member function ‘void GameBoard::draw()’:
/home/yochanan/freegemas/src/GameBoard.cpp:299:12: error: ‘bind’ is not a member of ‘std’
       std::bind(&FloatingScore::draw, _1));
            ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:299:12: note: suggested alternative: ‘find’
       std::bind(&FloatingScore::draw, _1));
            ^~~~
            find
/home/yochanan/freegemas/src/GameBoard.cpp:299:39: error: ‘_1’ was not declared in this scope
       std::bind(&FloatingScore::draw, _1));
                                       ^~
/home/yochanan/freegemas/src/GameBoard.cpp:299:39: note: suggested alternative: ‘y1’
       std::bind(&FloatingScore::draw, _1));
                                       ^~
                                       y1
/home/yochanan/freegemas/src/GameBoard.cpp:304:12: error: ‘bind’ is not a member of ‘std’
       std::bind(&ParticleSystem::draw, _1));
            ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:304:12: note: suggested alternative: ‘find’
       std::bind(&ParticleSystem::draw, _1));
            ^~~~
            find
make[2]: *** [CMakeFiles/freegemas.dir/build.make:183: CMakeFiles/freegemas.dir/src/GameBoard.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/freegemas.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
JoseTomasTocino commented 6 years ago

Uhm somehow it looks like it's not setting the compiler to use C++11. Could you add this to your CMakeLists.txt and build again?

set (CMAKE_CXX_STANDARD 11)
yochananmarqos commented 6 years ago

I guess I never saw your reply and completely forgot about this. I tried building again adding that line to /freegemas/CMakeLists.txt:

build]$ cmake ..
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /usr/sbin/cc
-- Check for working C compiler: /usr/sbin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/sbin/c++
-- Check for working CXX compiler: /usr/sbin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/sbin/pkg-config (found version "0.29.2") 
-- Checking for one of the modules 'sdl2'
-- Checking for one of the modules 'SDL2_image>=2.0.0'
-- Checking for one of the modules 'SDL2_ttf>=2.0.0'
-- Checking for one of the modules 'SDL2_mixer>=2.0.0'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yochanan/freegemas/build
build]$ make
[  0%] Built target link_media_folder
[  4%] Building CXX object CMakeFiles/freegemas.dir/src/GameBoard.cpp.o
/home/yochanan/freegemas/src/GameBoard.cpp:6:22: error: ‘placeholders’ is not a namespace-name
 using namespace std::placeholders;
                      ^~~~~~~~~~~~
/home/yochanan/freegemas/src/GameBoard.cpp:6:34: error: expected namespace-name before ‘;’ token
 using namespace std::placeholders;
                                  ^
/home/yochanan/freegemas/src/GameBoard.cpp: In member function ‘void GameBoard::update()’:
/home/yochanan/freegemas/src/GameBoard.cpp:258:25: error: ‘bind’ is not a member of ‘std’
                    std::bind<bool>(&FloatingScore::ended, _1)),
                         ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:258:25: note: suggested alternative: ‘find’
                    std::bind<bool>(&FloatingScore::ended, _1)),
                         ^~~~
                         find
/home/yochanan/freegemas/src/GameBoard.cpp:258:30: error: expected primary-expression before ‘bool’
                    std::bind<bool>(&FloatingScore::ended, _1)),
                              ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:265:25: error: ‘bind’ is not a member of ‘std’
                    std::bind<bool>(&ParticleSystem::ended, _1)),
                         ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:265:25: note: suggested alternative: ‘find’
                    std::bind<bool>(&ParticleSystem::ended, _1)),
                         ^~~~
                         find
/home/yochanan/freegemas/src/GameBoard.cpp:265:30: error: expected primary-expression before ‘bool’
                    std::bind<bool>(&ParticleSystem::ended, _1)),
                              ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp: In member function ‘void GameBoard::draw()’:
/home/yochanan/freegemas/src/GameBoard.cpp:299:12: error: ‘bind’ is not a member of ‘std’
       std::bind(&FloatingScore::draw, _1));
            ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:299:12: note: suggested alternative: ‘find’
       std::bind(&FloatingScore::draw, _1));
            ^~~~
            find
/home/yochanan/freegemas/src/GameBoard.cpp:299:39: error: ‘_1’ was not declared in this scope
       std::bind(&FloatingScore::draw, _1));
                                       ^~
/home/yochanan/freegemas/src/GameBoard.cpp:299:39: note: suggested alternative: ‘y1’
       std::bind(&FloatingScore::draw, _1));
                                       ^~
                                       y1
/home/yochanan/freegemas/src/GameBoard.cpp:304:12: error: ‘bind’ is not a member of ‘std’
       std::bind(&ParticleSystem::draw, _1));
            ^~~~
/home/yochanan/freegemas/src/GameBoard.cpp:304:12: note: suggested alternative: ‘find’
       std::bind(&ParticleSystem::draw, _1));
            ^~~~
            find
make[2]: *** [CMakeFiles/freegemas.dir/build.make:183: CMakeFiles/freegemas.dir/src/GameBoard.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/freegemas.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
JoseTomasTocino commented 5 years ago

Fixed in #3