johnBuffer/AntSimulator

Can't compile on Arch Linux

victormihalache opened this issue · 3 comments

I have:

  1. Cloned the repo
  2. Installed sfml with pacman -S sfml (cmake was already there)
  3. Ran ./install.sh in the repo folder

And got the following:

[victor@vicm AntSimulator]$ ./install.sh 
-- The CXX compiler identification is GNU 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SFML 2.5.1 in /usr/lib64/cmake/SFML
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/victor/Desktop/AntSimulator/build
[ 25%] Building CXX object CMakeFiles/AntSimulator.dir/src/display_manager.cpp.o
In file included from /home/victor/Desktop/AntSimulator/include/world_renderer.hpp:4,
                 from /home/victor/Desktop/AntSimulator/include/world.hpp:11,
                 from /home/victor/Desktop/AntSimulator/include/display_manager.hpp:4,
                 from /home/victor/Desktop/AntSimulator/src/display_manager.cpp:1:
/home/victor/Desktop/AntSimulator/include/config.hpp:71:69: error: 'Conf' was not declared in this scope
   71 | sf::Vector2f DefaultConf<T>::COLONY_POSITION = sf::Vector2f(500.0f, Conf::WIN_HEIGHT * 0.5f);
      |                                                                     ^~~~
In file included from /home/victor/Desktop/AntSimulator/include/colony_base.hpp:3,
                 from /home/victor/Desktop/AntSimulator/include/ant.hpp:10,
                 from /home/victor/Desktop/AntSimulator/include/colony.hpp:5,
                 from /home/victor/Desktop/AntSimulator/include/display_manager.hpp:5,
                 from /home/victor/Desktop/AntSimulator/src/display_manager.cpp:1:
/home/victor/Desktop/AntSimulator/include/racc.hpp: In member function 'T RDiff<T>::get() const':
/home/victor/Desktop/AntSimulator/include/racc.hpp:90:16: error: 'values' was not declared in this scope
   90 |         return values[getIndex(-1)] - values[getIndex()];
      |                ^~~~~~
/home/victor/Desktop/AntSimulator/include/racc.hpp:90:23: error: there are no arguments to 'getIndex' that depend on a template parameter, so a declaration of 'getIndex' must be available [-fpermissive]
   90 |         return values[getIndex(-1)] - values[getIndex()];
      |                       ^~~~~~~~
/home/victor/Desktop/AntSimulator/include/racc.hpp:90:23: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/victor/Desktop/AntSimulator/include/racc.hpp:90:46: error: there are no arguments to 'getIndex' that depend on a template parameter, so a declaration of 'getIndex' must be available [-fpermissive]
   90 |         return values[getIndex(-1)] - values[getIndex()];
      |                                              ^~~~~~~~
make[2]: *** [CMakeFiles/AntSimulator.dir/build.make:76: CMakeFiles/AntSimulator.dir/src/display_manager.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/AntSimulator.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Am I missing something? Last commit the branch master has at time of cloning: 245f8c4

Your not missing anything, this is on my side. I will fix this, it's because of MSVC being more permissive than GCC

I just pushed some fixes, it now complies fine on clang. Can you confirm it's also working fine on your side ?

Yes, it compiles and runs now. Thank you