Partage
  • Partager sur Facebook
  • Partager sur Twitter

Erreur en compilation

le compilateur ne trouve pas la définition de ma classe.

Sujet résolu
    5 novembre 2023 à 18:01:32

    Salut j'ai une classe Cell comme ceci :

    #ifndef ODFAEG_ECS_CELL_HPP
    #define ODFAEG_ECS_CELL_HPP
    #include "../../Physics/boundingPolyhedron.h"
    #include "../../Core/ecs.hpp"
    #include "../../Core/entityFactory.hpp"
    #include <vector>
    namespace odfaeg {
        namespace graphic {
            namespace ecs {
                /**
              * \file Cell.h
              * \class Cell
              * \brief Represent a cell of a space partitioning structure.
              * \author Duroisin.L
              * \version 1.0
              * \date 1/02/2014
              *  Represent a cell of a space partitioning structure.
              */
                class Cell {
                    public :
                        /**
                        * \fn Cell (BoundingPolyhedron* bp, Vec3f coords);
                        * \brief constructor.
                        * \param bp : the volume of the cell.
                        * \param coords : the coords of the cell.
                        */
                        Cell (physic::BoundingPolyhedron bp, math::Vec3f coords);
                        /**
                        * \fn BoundingPolyhedron* getCellVolume ();
                        * \return the volume of the cell.
                        */
                        physic::BoundingPolyhedron getCellVolume ();
                        /**
                        * \fn E* getEntityInside (int index);
                        * \brief get an entity which is into the cell by its index.
                        * \param the index.
                        * \return a pointer to the entity.
                        */
                        EntityId getEntityInside (unsigned int index);
                        unsigned int getNbEntitiesInside();
                        /**
                        * \fn std::vector<E*> getEntitiesInside ();
                        * \brief get the visible entities which are inside the cell.
                        * \return all the visible entities which are inside the cells.
                        */
                        std::vector<EntityId> getEntitiesInside ();
                        /**
                        * \fn bool isEntityInside ();
                        * \brief test if there is at least an entity is inside a cell.
                        * \return if there is at least an entity inside the cell.
                        */
                        bool isEntityInside ();
                        /**
                        * \fn bool containsEntity (E *entity);
                        * \brief test if a cell contains an entity.
                        * \param entity : the entity.
                        * \return if the cells contains the entity.
                        */
                        bool containsEntity (EntityId entity);
                        /**
                        * \fn  void addEntity (E *entity);
                        * \brief add an entity into the cell.
                        * \param entity : the entity.
                        */
                        void addEntity (EntityId entity);
                        /**
                        * \fn bool removeEntity (E * entity);
                        * \brief remove an entity from the cell.
                        * \param entity : the entity to remove.
                        */
                        bool removeEntity (EntityId entity);
                        bool removeEntity (std::string type);
                        /**
                        * \fn void setStateChanged (bool b);
                        * \brief set if the state of the cells have been changed. (This happens when the cell become passable or not passable)
                        * \param b : if the state have been changed.
                        */
                        void setStateChanged (bool b);
                        /**
                        * \fn  bool isStateChanged ();
                        * \brief tells is the state of the cell has been changed.
                        * \return if the cell has already been visited.
                        */
                        bool isStateChanged ();
                        /**
                        * \fn bool isPassable()
                        * \brief check if we can pass on the cell or not.
                        * \return if we can pass on the cell.
                        */
                        bool isPassable ();
                        /**
                        * \fn void setPassable (bool passable);
                        * \brief set if the cell is passable or not.
                        * \param passable : if the cell is passable or not.
                        */
                        void setPassable (bool passable);
                        /**
                        * \fn  bool operator== (const Cell &cell);
                        * \brief test if the cell is equal with another one.
                        * \param cell : the other cell.
                        * \return if the two cells are equal.
                        */
                        bool operator== (const Cell &cell);
                        /**
                        * \fn Vec3f getCoords ();
                        * \brief get the coordinates of the cells. (Usefull to store the cell into the vector of a grid)
                        * \return the coordinates of the cell.
                        */
                        math::Vec3f getCoords ();
                        /** \fn Vec3f& getCenter ();
                        *   \brief get the center of the cell.
                        *   \return the center of the cell.
                        */
                        math::Vec3f getCenter ();
                        /**
                        * \fn bool isTraveled ();
                        * \brief test is the cell has already been visited or not. (Used for the pathfinding algorithm)
                        * \return if the cell has already been visited.
                        */
                        bool isTraveled ();
                        /**
                        * \fn void setTraveled (bool traveled);
                        * \brief set if the cell has already been traveled or not.
                        * \param traveled : if the cell has already been visited.
                        */
                        void setTraveled (bool traveled);
                        /**
                        * \fn ~Cell();
                        * \brief destructor.
                        */
                        /*bool removeEntity (std::string type);
                        bool deleteEntity (std::string type);*/
                    private :
                        std::vector<EntityId> entitiesInside; /**> the entities which are inside the cell.*/
                        physic::BoundingPolyhedron cellVolume; /**> the volume of the cell.*/
                        bool passable, stateChanged, traveled; /**> if the cell is passable, if the state of the cell have been changed and if the cell have been visited.*/
                        math::Vec3f coords; /**> the coordinates and the center of the cell.*/
                };
            }
        }
    }
    #endif
    

    Et une classe grid comme ceci :

    #ifndef ODFAEG_ECS_GRID_HPP
    #define ODFAEG_ECS_GRID_HPP
    #include "cell.hpp"
    #include "../../Math/vec4.h"
    #include "../baseChangementMatrix.h"
    #include "../../Physics/boundingVolume.h"
    
    namespace odfaeg {
        namespace graphic {
            namespace ecs {
    
                class Grid {
                    public :
                        /**
                        * \fn  CellMap<Entity>* getGridCellAtFromCoords(Vec3f coords)
                        * \brief get the cell at a given position.
                        * \param Vec3f coords : the coordinates of the cell.
                        */
                        Cell* getGridCellAtFromCoords(math::Vec3f coords);
                        /**
                        * \fn GridMap(int cellWith, int cellHeight, int nbLayers)
                        * \brief constructor.
                        * \param cellWidth : the width of the cells.
                        * \param cellHeight : the height of the cells.
                        * \param nbLayers : the depth of the cells.
                        */
                        Grid (int cellWidth=100, int cellHeight=50, int cellDepth=0);
                        /** \fn  ~GridMap ();
                        *   \brief destructor.
                        */
                        ~Grid ();
                        /**
                        * \fn bool addEntity (Entity *entity);
                        * \brief add an entity into the grid.
                        * \param Entity* entity : the entity to add.
                        * \return if the entity has been successfully added.
                        */
                        bool addEntity (physic::BoundingBox globalBounds, EntityId entity);
                        /**
                        * \fn Entity* getEntity (int id);
                        * \brief get an entity depending on the given id.
                        * \param id : the id of the entity.
                        * \return the entity.
                        */
                        EntityId getEntity (ComponentMapping mapping, int id);
                        //EntityId getEntity (std::string name);
                        /**
                        * \fn deleteEntity(Entity* entity)
                        * \brief remove an entity from the grid and from the memory.
                        * \param entity : the entity to delete.
                        * \return if the entity has been successfully deleted.
                        */
                        bool removeEntity(physic::BoundingBox globalBounds, EntityId entity);
                        /**
                        * \fn  bool collideWithEntity(Entity* entity);
                        * \brief check if an entity collide with the entity of the grid.
                        * \param entity : check if the entity is colliding with an entity (or a cell) of the grid.
                        * \return if the entity is in collision with the grid.
                        */
                        vector<Cell*> getNeightbours(Entity* entity, Cell *cell, bool getCellOnPassable);
                        bool collideWithEntity(ComponentMapping& componentMapping, EntityId entity);
                        bool collideWithEntity(ComponentMapping& mapping, EntityId entity, math::Vec3f position);
                        /**
                        * \fn std::vector<Entity*> getEntities()
                        * \brief return every entities which are stored into each cells of the grid.
                        */
                        std::vector<EntityId> getEntities ();
                        /**
                        * \fn  std::vector<CellMap<Entity>*> getCasesMap()
                        * \brief get every cells of the map.
                        * \return the cells.
                        */
                        std::vector<Cell*> getCells ();
                        /**
                        * \fn std::vector<CellMap<Entity>*> getCasesInBox(BoundingBox bx)
                        * \brief return every cells which are in the given bounding box.
                        * \param bx : the bounding box.
                        * \return the cells in the bounding box.
                        */
                        std::vector<Cell*> getCellsInBox(physic::BoundingBox bx);
                        /**
                        * \fn bool  containsEntity (Entity *entity, Vec3f pos);
                        * \brief check if the grid contains the entity at the given pos.
                        * \param entity : the entity.
                        * \param Vec3f pos : the given position.
                        */
                        bool  containsEntity (EntityId entity, math::Vec3f pos);
                        /**
                        * \fn std::vector<Entity*> getEntitiesInBox(BoundingBox bx)
                        * \brief get the entities which are in the given bounding box.
                        * \param bx : the bounding box.
                        * \return std::vector<Entity*> : the entities.
                        */
                        std::vector<EntityId> getEntitiesInBox(physic::BoundingBox box);
                        /**
                        * \fn  CellMap<Entity>* getGridCellAt (Vec3f point)
                        * \brief get the cell at the given position.
                        * \param point : the point.
                        * \return the cell.
                        */
                        Cell* getGridCellAt (math::Vec3f point);
                        /**
                        * \fn Vec3f getCoordinatesAt (Vec3f &point);
                        * \brief get the cell's coordinates at the given pos.
                        * \param point : the position.
                        * \return Vec3f the coordinates.
                        */
                        math::Vec3f getCoordinatesAt (math::Vec3f &point);
                        /**
                        * \fn void createCellMap(Vec3f &point);
                        * \brief create a cell a the given position.
                        * \param point : the position.
                        */
                        void createCell(math::Vec3f &point);
                        /**
                        * \fn Vec3f getMins ()
                        * \brief return the minimums of the grid.
                        * \return the minimums of the grid.
                        */
                        math::Vec3f getMins ();
                        /**
                        * \fn Vec3f getSize ();
                        * \brief return the size of the grid.
                        * \return Vec3f the size.
                        */
                        math::Vec3f getSize ();
                        /**
                        * \fn int getNbCasesPerRow ();
                        * \brief return the number of cases per row.
                        * \return the number of cases per row.
                        */
                        int getNbCellsPerRow ();
                        /**
                        * \fn int getNbCasesPerCol ();
                        * \brief return the number of cases per col.
                        * \return the number of cases per col.
                        */
                        int getNbCellsPerCol ();
                        /**
                        * \fn void setBaseChangementMatrix (BaseChangementMatrix bm)
                        * \brief change the base changement matrix.
                        * \param bm : the base changement matrix.
                        */
                        void setBaseChangementMatrix (BaseChangementMatrix bm);
                        /**
                        * \fn BaseChangementMatrix getBaseChangementMatrix()
                        * \brief get the base changement matrix.
                        * \return the base changement matrix.
                        */
                        BaseChangementMatrix getBaseChangementMatrix();
                        /**
                        * \fn int getCellDepth();
                        * \brief get the depth of the cell.
                        * \return the depth of the cell.
                        */
                        int getCellDepth();
                        /**
                        * \fn int getCellWidth();
                        * \brief get the width of the cell.
                        * \return the with of the cell.
                        */
                        int getCellWidth ();
                        /**
                        * \fn int getCellHeight();
                        * \brief get the height of the cell.
                        * \return the height of the cell.
                        */
                        int getCellHeight ();
                        int getOffsetX() {
                            return offsetX;
                        }
                        int getOffsetY() {
                            return offsetY;
                        }
                        int getOffsetZ() {
                            return offsetZ;
                        }
                        private:
                        BaseChangementMatrix bm; /**> the base changement matrix.*/
                        /**
                        * \fn void checkExts()
                        * \brief check the extremity of the grid.
                        */
                        void checkExts();
                        /**
                        * \fn void removeCellMap (CellMap<Entity> *cell)
                        * \brief remove a cell from the grid and from the memory.
                        * \param cell : the cell to remove.
                        */
                        void removeCell (Cell *cell);
                    private :
                        std::vector<Cell*> cells; /**Cells of the grid, I use a raw pointer here because, the grid is dynamic so I have to copy the pointers.*/
                        int nbCellsPerRow, nbCellsPerCol, /**> the number of cases per row, the number of cases per columns*/
                        minX, minY, minZ, maxX, maxY, maxZ, /**> the mins and maxs of the grid.*/
                        cellWidth, cellHeight, cellDepth, /**> the dimentions of the cells of the grid.*/
                        offsetX, offsetY, offsetZ; /**> the offsets of the cells of the grid.*/
                };
            }
        }
    }
    #endif
    

    Mais le compilateur ne trouve pas la class Cell il me dit qu'elle n'existe pas et même chose pour les classes que j'inclus dans cell.hpp

    In file included from /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/components.hpp:11,
                     from /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/ecs.hpp:4,
                     from /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/cell.hpp:4,
                     from /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/cell.cpp:1:
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:19:21: error: ‘Cell’ does not name a type
       19 |                     Cell* getGridCellAtFromCoords(math::Vec3f coords);
          |                     ^~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:38:71: error: ‘EntityId’ has not been declared
       38 |           bool addEntity (physic::BoundingBox globalBounds, EntityId entity);
          |                                                             ^~~~~~~~
    
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:45:21: error: ‘EntityId’ does not name a type; did you mean ‘Entity’?
       45 |                     EntityId getEntity (ComponentMapping mapping, int id);
          |                     ^~~~~~~~
          |                     Entity
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:53:73: error: ‘EntityId’ has not been declared
       53 |         bool removeEntity(physic::BoundingBox globalBounds, EntityId entity);
          |                                                             ^~~~~~~~
    
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
       60 |                     vector<Cell*> getNeightbours(Entity* entity, Cell *cell, bool getCellOnPassable);
          |                            ^~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:28: error: ‘Cell’ was not declared in this scope
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:60:21: error: ‘vector’ does not name a type
       60 |                     vector<Cell*> getNeightbours(Entity* entity, Cell *cell, bool getCellOnPassable);
          |                     ^~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:61:44: error: ‘ComponentMapping’ has not been declared
       61 |                     bool collideWithEntity(ComponentMapping& componentMapping, EntityId entity);
          |                                            ^~~~~~~~~~~~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:61:80: error: ‘EntityId’ has not been declared
       61 |  bool collideWithEntity(ComponentMapping& componentMapping, EntityId entity);
          |                                                             ^~~~~~~~
    
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:62:44: error: ‘ComponentMapping’ has not been declared
       62 |                     bool collideWithEntity(ComponentMapping& mapping, EntityId entity, math::Vec3f position);
          |                                            ^~~~~~~~~~~~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:62:71: error: ‘EntityId’ has not been declared
       62 |           bool collideWithEntity(ComponentMapping& mapping, EntityId entity, math::Vec3f position);
          |                                                             ^~~~~~~~
    
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:67:33: error: ‘EntityId’ was not declared in this scope; did you mean ‘Entity’?
       67 |                     std::vector<EntityId> getEntities ();
          |                                 ^~~~~~~~
          |                                 Entity
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:67:41: error: template argument 1 is invalid
       67 |                     std::vector<EntityId> getEntities ();
          |                                         ^
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:67:41: error: template argument 2 is invalid
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:67:26: error: ‘<expression error>’ in namespace ‘std’ does not name a type
       67 |                     std::vector<EntityId> getEntities ();
          |                          ^~~~~~~~~~~~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:73:33: error: ‘Cell’ was not declared in this scope
       73 |                     std::vector<Cell*> getCells ();
          |                                 ^~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:73:38: error: template argument 1 is invalid
       73 |                     std::vector<Cell*> getCells ();
          |                                      ^
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:73:38: error: template argument 2 is invalid
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:73:26: error: ‘<expression error>’ in namespace ‘std’ does not name a type
       73 |                     std::vector<Cell*> getCells ();
          |                          ^~~~~~~~~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:80:33: error: ‘Cell’ was not declared in this scope
       80 |                     std::vector<Cell*> getCellsInBox(physic::BoundingBox bx);
          |                                 ^~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:80:38: error: template argument 1 is invalid
       80 |                     std::vector<Cell*> getCellsInBox(physic::BoundingBox bx);
          |                                      ^
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:80:38: error: template argument 2 is invalid
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:80:26: error: ‘<expression error>’ in namespace ‘std’ does not name a type
       80 |                     std::vector<Cell*> getCellsInBox(physic::BoundingBox bx);
          |                          ^~~~~~~~~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:87:43: error: ‘EntityId’ has not been declared
       87 |                     bool  containsEntity (EntityId entity, math::Vec3f pos);
          |                                           ^~~~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:94:33: error: ‘EntityId’ was not declared in this scope; did you mean ‘Entity’?
       94 |                     std::vector<EntityId> getEntitiesInBox(physic::BoundingBox box);
          |                                 ^~~~~~~~
          |                                 Entity
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:94:41: error: template argument 1 is invalid
       94 |                     std::vector<EntityId> getEntitiesInBox(physic::BoundingBox box);
          |                                         ^
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:94:41: error: template argument 2 is invalid
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:94:26: error: ‘<expression error>’ in namespace ‘std’ does not name a type
       94 |                     std::vector<EntityId> getEntitiesInBox(physic::BoundingBox box);
          |                          ^~~~~~~~~~~~~~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:101:21: error: ‘Cell’ does not name a type
      101 |                     Cell* getGridCellAt (math::Vec3f point);
          |                     ^~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:190:38: error: ‘Cell’ has not been declared
      190 |                     void removeCell (Cell *cell);
          |                                      ^~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:192:33: error: ‘Cell’ was not declared in this scope
      192 |                     std::vector<Cell*> cells; /**Cells of the grid, I use a raw pointer here because, the grid is dynamic so I have to copy the pointers.*/
          |                                 ^~~~
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:192:38: error: template argument 1 is invalid
      192 |                     std::vector<Cell*> cells; /**Cells of the grid, I use a raw pointer here because, the grid is dynamic so I have to copy the pointers.*/
          |                                      ^
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:192:38: error: template argument 2 is invalid
    /home/laurent/gitODFAEG/ODFAEG/src/odfaeg/Graphics/ECS/../../../../include/odfaeg/Graphics/ECS/../../Core/../Graphics/ECS/grid.hpp:192:26: error: ‘<expression error>’ in namespace ‘std’ does not name a type
      192 |                     std::vector<Cell*> cells; /**Cells of the grid, I use a raw pointer here because, the grid is dynamic so I have to copy the pointers.*/
          |                          ^~~~~~~~~~~~~
    

    Merci.




    -
    Edité par OmbreNoire 5 novembre 2023 à 18:01:58

    • Partager sur Facebook
    • Partager sur Twitter
      5 novembre 2023 à 19:17:05

      Bonjour,

      cell.hpp avant de définir Cell, utilise des #include, en particulier "ecs.hpp" qui inclut "components.hpp" qui inclut "grid.hpp"

      Donc le définition de Grid est vue avant celle de Cell qui ne sera qu'après les #include.

      Il faut revoir la chaîne des dépendances.

      • Partager sur Facebook
      • Partager sur Twitter
        5 novembre 2023 à 19:56:26

        Salut!

        Ah oui j'avais oublié de retirer l'include de grid.hpp dans component, merci!

        • Partager sur Facebook
        • Partager sur Twitter

        Erreur en compilation

        × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
        × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
        • Editeur
        • Markdown