Closed yochananmarqos closed 5 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)
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
Fixed in #3
I get the following error building on Manjaro whether I attempt to use the AUR package or build it myself: