AntSimulator icon indicating copy to clipboard operation
AntSimulator copied to clipboard

Build failed on latest master

Open krishvishal opened this issue 3 years ago • 5 comments

I executed ./install.sh to build the project and got a long compilation error.

Stack trace:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/kv/AntSimulator/build
[ 25%] Building CXX object CMakeFiles/AntSimulator.dir/src/display_manager.cpp.o
In file included from /home/kv/AntSimulator/include/world_grid.hpp:6:0,
                 from /home/kv/AntSimulator/include/world.hpp:6,
                 from /home/kv/AntSimulator/include/display_manager.hpp:4,
                 from /home/kv/AntSimulator/src/display_manager.cpp:1:
/home/kv/AntSimulator/include/grid.hpp: In constructor ‘GridOfNumber<T>::GridOfNumber(int32_t, int32_t, uint32_t)’:
/home/kv/AntSimulator/include/grid.hpp:81:5: error: class ‘GridOfNumber<T>’ does not have any field named ‘Grid’
   : Grid(width_, height_, cell_size_)
     ^~~~
/home/kv/AntSimulator/include/grid.hpp: In constructor ‘GridOfList<T>::GridOfList(int32_t, int32_t, uint32_t)’:
/home/kv/AntSimulator/include/grid.hpp:112:5: error: class ‘GridOfList<T>’ does not have any field named ‘Grid’
   : Grid(width_, height_, cell_size_)
     ^~~~
/home/kv/AntSimulator/include/grid.hpp: In member function ‘T* GridOfList<T>::emplaceAtPosition(sf::Vector2i)’:
/home/kv/AntSimulator/include/grid.hpp:118:7: error: there are no arguments to ‘checkCell’ that depend on a template parameter, so a declaration of ‘checkCell’ must be available [-fpermissive]
   if (checkCell(pos)) {
       ^~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:118:7: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/kv/AntSimulator/include/grid.hpp:119:25: error: there are no arguments to ‘get’ that depend on a template parameter, so a declaration of ‘get’ must be available [-fpermissive]
    GridListCell<T>& c = get(pos);
                         ^~~
/home/kv/AntSimulator/include/grid.hpp: In member function ‘T* GridOfList<T>::emplaceAtPosition(sf::Vector2f)’:
/home/kv/AntSimulator/include/grid.hpp:128:28: error: there are no arguments to ‘getCellCoords’ that depend on a template parameter, so a declaration of ‘getCellCoords’ must be available [-fpermissive]
   return emplaceAtPosition(getCellCoords(pos));
                            ^~~~~~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp: In member function ‘void GridOfList<T>::clearAt(sf::Vector2f)’:
/home/kv/AntSimulator/include/grid.hpp:138:22: error: there are no arguments to ‘getCellCoords’ that depend on a template parameter, so a declaration of ‘getCellCoords’ must be available [-fpermissive]
   auto cell_coords = getCellCoords(position);
                      ^~~~~~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:139:3: error: ‘cells’ was not declared in this scope
   cells[getIndexFromCoords(cell_coords)].data.clear();
   ^~~~~
/home/kv/AntSimulator/include/grid.hpp:139:3: note: suggested alternative: ‘ceill’
   cells[getIndexFromCoords(cell_coords)].data.clear();
   ^~~~~
   ceill
/home/kv/AntSimulator/include/grid.hpp: In member function ‘T* GridOfList<T>::add(const Vector2i&, const T&)’:
/home/kv/AntSimulator/include/grid.hpp:144:7: error: there are no arguments to ‘checkCell’ that depend on a template parameter, so a declaration of ‘checkCell’ must be available [-fpermissive]
   if (checkCell(cell_coords)) {
       ^~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:145:28: error: ‘cells’ was not declared in this scope
    GridListCell<T>& cell = cells[getIndexFromCoords(cell_coords)];
                            ^~~~~
/home/kv/AntSimulator/include/grid.hpp:145:28: note: suggested alternative: ‘cell’
    GridListCell<T>& cell = cells[getIndexFromCoords(cell_coords)];
                            ^~~~~
                            cell
/home/kv/AntSimulator/include/grid.hpp:145:34: error: there are no arguments to ‘getIndexFromCoords’ that depend on a template parameter, so a declaration of ‘getIndexFromCoords’ must be available [-fpermissive]
    GridListCell<T>& cell = cells[getIndexFromCoords(cell_coords)];
                                  ^~~~~~~~~~~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp: In member function ‘std::__cxx11::list<T*> GridOfList<T>::getAllAt(const Vector2f&)’:
/home/kv/AntSimulator/include/grid.hpp:155:36: error: there are no arguments to ‘getCellCoords’ that depend on a template parameter, so a declaration of ‘getCellCoords’ must be available [-fpermissive]
   const sf::Vector2i cell_coords = getCellCoords(position);
                                    ^~~~~~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:160:9: error: there are no arguments to ‘checkCell’ that depend on a template parameter, so a declaration of ‘checkCell’ must be available [-fpermissive]
     if (checkCell(coords)) {
         ^~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:161:27: error: there are no arguments to ‘get’ that depend on a template parameter, so a declaration of ‘get’ must be available [-fpermissive]
      GridListCell<T>& c = get(coords);
                           ^~~
/home/kv/AntSimulator/include/grid.hpp: In member function ‘GridListCell<T>* GridOfList<T>::getAt(const Vector2f&)’:
/home/kv/AntSimulator/include/grid.hpp:174:36: error: there are no arguments to ‘getCellCoords’ that depend on a template parameter, so a declaration of ‘getCellCoords’ must be available [-fpermissive]
   const sf::Vector2i cell_coords = getCellCoords(position);
                                    ^~~~~~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:176:7: error: there are no arguments to ‘checkCell’ that depend on a template parameter, so a declaration of ‘checkCell’ must be available [-fpermissive]
   if (checkCell(cell_coords)) {
       ^~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:177:12: error: ‘cells’ was not declared in this scope
    return &cells[getIndexFromCoords(cell_coords)];
            ^~~~~
/home/kv/AntSimulator/include/grid.hpp:177:12: note: suggested alternative: ‘ceill’
    return &cells[getIndexFromCoords(cell_coords)];
            ^~~~~
            ceill
/home/kv/AntSimulator/include/grid.hpp:177:18: error: there are no arguments to ‘getIndexFromCoords’ that depend on a template parameter, so a declaration of ‘getIndexFromCoords’ must be available [-fpermissive]
    return &cells[getIndexFromCoords(cell_coords)];
                  ^~~~~~~~~~~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp: In member function ‘bool GridOfList<T>::isEmpty(const Vector2f&) const’:
/home/kv/AntSimulator/include/grid.hpp:185:36: error: there are no arguments to ‘getCellCoords’ that depend on a template parameter, so a declaration of ‘getCellCoords’ must be available [-fpermissive]
   const sf::Vector2i cell_coords = getCellCoords(position);
                                    ^~~~~~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:187:7: error: there are no arguments to ‘checkCell’ that depend on a template parameter, so a declaration of ‘checkCell’ must be available [-fpermissive]
   if (checkCell(cell_coords)) {
       ^~~~~~~~~
/home/kv/AntSimulator/include/grid.hpp:188:11: error: there are no arguments to ‘getCst’ that depend on a template parameter, so a declaration of ‘getCst’ must be available [-fpermissive]
    return getCst(cell_coords).data.empty();
           ^~~~~~
CMakeFiles/AntSimulator.dir/build.make:62: recipe for target 'CMakeFiles/AntSimulator.dir/src/display_manager.cpp.o' failed
make[2]: *** [CMakeFiles/AntSimulator.dir/src/display_manager.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/AntSimulator.dir/all' failed
make[1]: *** [CMakeFiles/AntSimulator.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

krishvishal avatar Apr 22 '21 20:04 krishvishal

Looking into this, I can reproduce on Ubuntu.

johnBuffer avatar Apr 23 '21 07:04 johnBuffer

Should be fixed, compiles fine on my side.

johnBuffer avatar Apr 23 '21 08:04 johnBuffer

Now its compiling fine. But I'm now getting an error when I run the generated executable AntSimulator.

Stack trace:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  56
  Current serial number in output stream:  57

Are any input args required to be passed while running the executable?

krishvishal avatar Apr 23 '21 08:04 krishvishal

This is strange, I don't have this issue and the executable doesn't require any arguments

johnBuffer avatar Apr 23 '21 08:04 johnBuffer

I've installed SFML using sudo apt-get install libsfml-dev. The version installed is 2.4.2+dfsg-4. GCC: gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

and

I've edited the Cmake file for the build to work as follows:

set(SOURCES ${source_files})
set(SFML_ROOT /usr/local/lib) # added this line
# Detect and add SFML
# set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
# find_package(SFML 2 REQUIRED COMPONENTS network audio graphics window system)

This configuration was working fine when I used AntSimulator a month ago.

krishvishal avatar Apr 23 '21 09:04 krishvishal