Partage
  • Partager sur Facebook
  • Partager sur Twitter

Erreur à l'édition des liens

undefined reference to addEntity,.

Sujet résolu
    14 août 2022 à 13:33:05

    Salut je possède une classe Grid que voici :

    Le .h :

    #ifndef ODFAEG_ECS_GRID_HPP
    #define ODFAEG_ECS_GRID_HPP
    #include "cell.hpp"
    #include "../../Math/vec4.h"
    #include "../baseChangementMatrix.h"
    #include "../../Physics/boundingBox.h"
    
    namespace odfaeg {
        namespace graphic {
            namespace ecs {
                class ColliderComponent;
                class TransformComponent;
                class Grid {
                    public :
                        /**
                        * \fn std::vector<CellMap<Entity>*> getNeightbours(Entity* entity, CellMap<Entity> *cell, bool getCellOnPassable);
                        * \brief get the neightbour cells of the given cell.
                        * \param Entity* entity : cell.
                        * \param bool getCellOnPassable : if we want to get the cells which are passable or not.
                        * \return the neightbour cells.
                        */
                        template <typename EntityComponentArray>
                        std::vector<Cell*> getNeightbours(EntityComponentArray eca, ComponentMapping mapping, EntityId entity, Cell *cell, bool getCellOnPassable) {
                            math::Vec3f coords = cell->getCoords();
                            std::vector<Cell*> neightbours;
                            for (int i = coords.x - 1; i <= coords.x + 1; i++) {
                                for (int j = coords.y - 1; j <= coords.y + 1; j++) {
                                    for (int k = coords.z - 1; k <= coords.z + 1; k++) {
                                        if (!(i == coords.x && j == coords.y && k == coords.z)) {
                                            math::Vec2f neightbourCoords(i, j);
                                            Cell *neightbour = getGridCellAtFromCoords(neightbourCoords);
                                            if (neightbour != nullptr) {
                                                if (getCellOnPassable)
                                                    neightbours.push_back(neightbour);
                                                else {
                                                    ColliderComponent* collider = mapping.getAgregate<ColliderComponent>(eca, entity);
                                                    if (collider != nullptr) {
                                                        bool collide = false;
                                                        math::Vec3f t = neightbour->getCenter() - collider->collisionVolume->getCenter();
                                                        std::unique_ptr<physic::BoundingVolume> cv = collider->collisionVolume->clone();
                                                        cv->move(t);
                                                        for (unsigned int k = 0; k < neightbour->getEntitiesInside().size() && !collide; k++) {
                                                            ColliderComponent* collider2 = mapping.getAgregate<ColliderComponent>(eca, cell->getEntitiesInside()[k]);
                                                            if (collider2 != nullptr && neightbour->getEntitiesInside()[k].get().load() != entity.get().load()) {
                                                                physic::CollisionResultSet::Info info;
                                                                if (cv->intersects(*collider2->collisionVolume, info)) {
                                                                    if (cv->getChildren().size() == 0) {
                                                                        collide = true;
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        if (!collide) {
                                                            neightbours.push_back(neightbour);
                                                        }
                                                    } else {
                                                        if (neightbour->isPassable()) {
                                                            neightbours.push_back(neightbour);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
    
                            return neightbours;
                        }
                        /**
                        * \fn std::vector<Vec3f> getPath (Entity* entity, Vec3f finalPos);
                        * \brief get the path between an entity and a destination
                        * \param Entity* entity : an entity.
                        * \param Vec3f finalPos : the destination.
                        * \return the points of the curve of the path.
                        */
                        template <typename EntityComponentArray>
                        std::vector<math::Vec3f> getPath (EntityComponentArray eca, ComponentMapping mapping, EntityId entity, math::Vec3f finalPos) {
                            TransformComponent* tc = mapping.getAgregate<TransformComponent>(eca, entity);
                            std::vector<math::Vec3f> positions;
                            if (tc != nullptr) {
                                math::Vec3f startPos = math::Vec3f(tc->center().x, tc->center.y, tc->center.z);
                                if (getGridCellAt(finalPos) != nullptr) {
                                    unsigned int cpt = 0;
                                    positions.push_back(startPos);
                                    math::Vec3f currentPos = getGridCellAt(startPos)->getCenter();
                                    if (currentPos != startPos)
                                        positions.push_back(currentPos);
                                    std::vector<Cell*> children;
                                    while (!getGridCellAt(finalPos)->isPassable() && cpt < 1000) {
                                        Cell *parent = getGridCellAt(finalPos);
    
                                        std::vector<Cell*> children = getNeightbours(eca, mapping, entity, parent, true);
    
                                        int distMin = children[0]->getCenter().computeDist(getGridCellAt(startPos)->getCenter());
                                        int indMin = 0;
                                        for (unsigned int i = 1; i < children.size(); i++) {
                                            std::cout<<children[i]->getCenter()<<std::endl;
                                            int dist = children[i]->getCenter().computeDist(getGridCellAt(startPos)->getCenter());
                                            if (dist < distMin) {
                                                distMin = dist;
                                                indMin = i;
                                            }
                                        }
                                        finalPos = children[indMin]->getCenter();
                                        cpt++;
                                    }
                                    //Tant qu'on est pas arrivé sur la case finale.
                                    while (getGridCellAt(currentPos) != getGridCellAt(finalPos) && cpt < 1000) {
                                        //On recherche les Cells fils. (ou voisines.)
    
                                        Cell *parent = getGridCellAt(currentPos);
                                        parent->setTraveled(true);
                                        std::vector<Cell*> children = getNeightbours(eca, mapping, entity, parent, false);
                                        //std::cout<<"size : "<<children.size()<<std::endl;
                                        unsigned int j = 0;
                                        while (j < children.size() && children[j]->isTraveled())
                                            j++;
                                        if (j == children.size())
                                            j--;
                                        int distMin = children[j]->getCenter().computeDist(getGridCellAt(finalPos)->getCenter());
                                        int indMin = j;
                                        for (unsigned int i = j; i < children.size(); i++) {
                                            if (!children[i]->isTraveled()) {
                                                int dist = children[i]->getCenter().computeDist(getGridCellAt(finalPos)->getCenter());
    
                                                if (dist < distMin) {
    
                                                    distMin = dist;
                                                    indMin = i;
                                                }
                                            }
                                        }
                                        currentPos = children[indMin]->getCenter();
                                        if (positions.size() > 1) {
                                            math::Vec3f v1 = positions[positions.size()-1] - positions[positions.size() - 2];
                                            math::Vec3f v2 = currentPos - positions[positions.size()-1];
                                            if (math::Math::abs(math::Math::toDegrees(v1.getAngleBetween(v2, v1.cross(v2)))) != 180)
                                                positions.push_back(currentPos);
                                        } else {
                                             positions.push_back(currentPos);
                                        }
                                        cpt++;
                                    }
                                    if (finalPos != positions.back())
                                        positions.push_back(finalPos);
                                    for (unsigned int i = 0; i < positions.size(); i++) {
                                         getGridCellAt(positions[i])->setTraveled(false);
                                    }
                                    if (cpt == 1000)
                                        positions.clear();
                                }
                            }
                            return positions;
                        }
                        /**
                        * \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.
                        */
                        template <typename EntityComponentArray>
                        bool collideWithEntity(EntityComponentArray eca, ComponentMapping mapping, EntityId entity, math::Vec3f position) {
                            Cell* cell = getGridCellAt(position);
                            if (cell != nullptr) {
                                if (!cell->isPassable())
                                    return true;
                                std::vector<Cell*> neightbours = getNeightbours(eca, mapping, entity,cell,true);
                                for (unsigned int i = 0; i < neightbours.size(); i++) {
                                    if (!neightbours[i]->isPassable()) {
                                        return true;
                                    }
                                }
                                EntityId rootId = mapping.getRoot(entity);
                                ColliderComponent* collider = mapping.getAgregate<ColliderComponent>(eca, rootId);
    
                                if (collider != nullptr) {
                                    math::Vec3f t = position - collider->collisionVolume->getCenter();
                                    physic::BoundingVolume* cv = collider->colidionVolume->clone().release();
                                    cv->move(t);
                                    for (unsigned int k = 0; k < cell->getEntitiesInside().size(); k++)  {
                                        ColliderComponent* collider2 = mapping.getAgregate<ColliderComponent>(eca, cell->getEntitiesInside()[k]);
                                        if (collider2 != nullptr && cell->getEntitiesInside()[k].get().load() != entity.get().load()) {
                                            physic::BoundingVolume* cv2 = collider2->boundingVolume;
                                            physic::CollisionResultSet::Info info;
                                            if (cv->intersects(*cv2, info)) {
                                                /*info.entity = cell->getEntitiesInside()[k]->getRootEntity();
                                                info.center = cv->getCenter();
                                                physic::CollisionResultSet::pushCollisionInfo(info);*/
                                                if (cv->getChildren().size() == 0) {
                                                    return true;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            return false;
                        }
                        /**
                        * \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.
                        */
                        template <typename EntityComponentArray>
                        std::vector<EntityId> getEntitiesInBox(EntityComponentArray da, ComponentMapping mapping, physic::BoundingBox box) {
                            std::vector<EntityId> entities;
                            int x = box.getPosition().x;
                            int y = box.getPosition().y;
                            int z = box.getPosition().z;
                            int endX = box.getPosition().x + box.getWidth();
                            int endY = box.getPosition().y + box.getHeight();
                            int endZ = box.getPosition().z + box.getDepth();
                            physic::BoundingBox bx (x, y, z, endX-x, endY-y, z - endZ);
                            for (int i = x; i <= endX; i+=offsetX) {
                                for (int j = y; j <= endY; j+=offsetY) {
                                    for (int k = z; k <= endZ; k+= offsetZ) {
                                        math::Vec3f point(i, j, k);
                                        Cell* cell = getGridCellAt(point);
                                        if (cell != nullptr) {
                                            for (unsigned int n = 0; n < cell->getEntitiesInside().size(); n++) {
                                               EntityId entity = cell->getEntityInside(n);
                                               bool contains = false;
                                               for (unsigned int k = 0; k < entities.size() && !contains; k++) {
                                                    if (entities[k].get().load() == entity.get().load())
                                                        contains = true;
                                               }
                                               physic::BoundingBox globalBounds = mapping.getAgregate<TransformComponent>(da, entity);
                                               if (!contains && bx.intersects(globalBounds) || bx.isInside(globalBounds) || globalBounds.isInside(bx)) {
    
                                                    entities.push_back(entity);
                                               }
                                            }
                                        }
                                    }
                                }
                            }
                            return entities;
                        }
                        /**
                        * \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

    et le .cpp :

    #include "../../../../include/odfaeg/Graphics/ECS/grid.hpp"
    
    using namespace std;
    namespace odfaeg {
        namespace graphic {
            namespace ecs {
                Grid::Grid (int cellWidth, int cellHeight, int cellDepth) {
                    nbCellsPerRow = 0;
                    nbCellsPerCol = 0;
                    minX = minY = minZ = std::numeric_limits<int>::max();
                    maxX = maxY = maxZ = std::numeric_limits<int>::min();
                    this->cellWidth = cellWidth;
                    this->cellHeight = cellHeight;
                    this->cellDepth = cellDepth;
                    offsetX = (cellWidth > 0) ? cellWidth * 0.5f : 1;
                    offsetY = (cellHeight > 0) ? cellHeight * 0.5f : 1;
                    offsetZ = (cellDepth > 0) ? cellDepth * 0.5f : 1;
    
                }
    
                int Grid::getCellWidth() {
                    return cellWidth;
                }
    
                int Grid::getCellHeight() {
                    return cellHeight;
                }
                int Grid::getCellDepth() {
                    return cellDepth;
                }
                int Grid::getNbCellsPerRow () {
                    return nbCellsPerRow;
                }
                int Grid::getNbCellsPerCol () {
                    return nbCellsPerCol;
                }
                void Grid::setBaseChangementMatrix(BaseChangementMatrix bm) {
                    this->bm = bm;
                }
    
                BaseChangementMatrix Grid::getBaseChangementMatrix() {
                    return bm;
                }
                bool Grid::addEntity (physic::BoundingBox globalBounds, EntityId entity){
                    int x = globalBounds.getPosition().x;
                    int y = globalBounds.getPosition().y;
                    int z = globalBounds.getPosition().z;
                    int endX = (x + globalBounds.getWidth());
                    int endY = (y + globalBounds.getHeight());
                    int endZ = (z + globalBounds.getDepth());
                    bool added = false;
                    /*std::array<math::Vec2f, 4> pos;
                    pos[0] = math::Vec2f(x, y);
                    pos[1] = math::Vec2f(x, y + endY);
                    pos[2] = math::Vec2f(x + endX, y + endY);
                    pos[3] = math::Vec2f(x + endX, y);
    
                    for (unsigned int i = 0; i < pos.size(); i++) {
                        if (!(containsEntity(entity, pos[i]))) {
                            Cell *cm = getGridCellAt(pos[i]);
                            if (cm == nullptr) {
                                createCell(pos[i]);
                                cm = getGridCellAt(pos[i]);
                            }
                            added = true;
                            cm->addEntity(entity);
                        }
                    }*/
                    //std::cout<<"offsets : "<<offsetX<<","<<offsetY<<","<<offsetZ<<std::endl<<"start : "<<x<<","<<y<<","<<z<<std::endl<<"ends : "<<endX<<","<<endY<<","<<endZ<<std::endl;
                    //std::cout<<"add entity : "<<entity->getType()<<std::endl<<x<<","<<y<<","<<z<<","<<endX<<","<<endY<<","<<endZ<<std::endl;
                    for (int i = x; i <= endX; i+= offsetX) {
                        for (int j = y; j <= endY; j+= offsetY)  {
                            for (int k = z; k <= endZ; k+= offsetZ) {
    
                                math::Vec3f pos (i, j, k);
                                //std::cout<<"pos : "<<pos<<std::endl;
    
    
                                if (!(containsEntity(entity, pos))) {
                                    //std::cout<<"get cell map"<<std::endl;
                                    Cell *cm = getGridCellAt(pos);
                                    //std::cout<<"create cell map"<<std::endl;
                                    if (cm == nullptr) {
                                        //std::cout<<"create cell map"<<std::endl;
                                        createCell(pos);
                                        cm = getGridCellAt(pos);
                                    }
                                    added = true;
    
                                    cm->addEntity(entity);
                                    /*if (entity->getType() == "E_BIGTILE")
                                      std::cout<<cm->getCoords()<<std::endl;*/
                                    //std::cout<<"entity added"<<std::endl;
                                    /*if (entity->getRootType() == "E_WALL") {
                                        int indice = (math::Math::abs(minX) + cm->getCoords().x)
                                        + (math::Math::abs(minY) + cm->getCoords().y) * nbCellsPerRow + (math::Math::abs(minZ) + cm->getCoords().z) * nbCellsPerCol;
                                        std::cout<<"add wall at : "<<pos<<cm->getCoords()<<minX<<std::endl<<"miny : "<<minY<<std::endl<<"minz : "<<minZ<<std::endl<<"nb Cells per row : "<<nbCellsPerRow<<std::endl<<"nb Cells per col : "<<nbCellsPerCol<<std::endl<<"index : "<<indice<<std::endl;
                                    }*/
                                    /*if (i == x && j == y && k == z && entity->getType() == "E_TILE") {*/
    
                                        /*int indice = (math::Math::abs(minX) + cm->getCoords().x)
                                                            + (math::Math::abs(minY) + cm->getCoords().y) * nbCellsPerRow + (math::Math::abs(minZ) + cm->getCoords().z) * nbCellsPerCol;
                                        std::cout<<"add entity mins : "<<pos<<std::endl<<minX<<","<<minY<<","<<minZ<<std::endl<<"maxs : "<<maxX<<","<<maxY<<","<<maxZ<<std::endl<<"nb Cells : "<<nbCellsPerRow<<","<<nbCellsPerCol<<std::endl<<"coords : "<<cm->getCoords()<<std::endl;*/
    
    
    
                                        //system("PAUSE");
                                    //}
    
                                }
                            }
                            //std::cout<<"leave k"<<std::endl;
                        }
                        //std::cout<<"leave j"<<std::endl;
                    }
                    //std::cout<<"entity added : "<<std::endl;
                    return added;
                }
    
                bool Grid::containsEntity(EntityId entity, math::Vec3f pos) {
                    Cell *cell = getGridCellAt(pos);
                    if (cell !=nullptr) {
                         if (cell->containsEntity(entity)) {
                             return true;
                         }
                    }
                    return false;
                }
    
                EntityId Grid::getEntity (ComponentMapping mapping, int id) {
                    for (unsigned int i = 0; i < cells.size(); i++) {
                        Cell *cm = cells[i];
                        if (cm != nullptr) {
                            for (unsigned int j = 0; j < cm->getEntitiesInside().size(); j++) {
                                EntityId entity = cm->getEntityInside(j);
                                if (*entity.get().load() == id) {
                                    return entity;
                                }
                                EntityId parent = mapping.branchIds[*entity.get().load()];
                                while (parent.get().load() != nullptr) {
                                    if (*parent.get().load() == id) {
                                        return parent;
                                    }
                                    parent = mapping.branchIds[*parent.get().load()];
                                }
                            }
                        }
                    }
                }
                /*EntityId Grid::getEntity (std::string name) {
                    for (unsigned int i = 0; i < cells.size(); i++) {
                        Cell *cm = cells[i];
                        if (cm != nullptr) {
                            for (unsigned int j = 0; j < cm->getEntitiesInside().size(); j++) {
                                Entity *entity = cm->getEntityInside(j);
                                if (entity->getName() == name) {
                                    return entity;
                                }
                                Entity* parent = entity->getParent();
                                while (parent != nullptr) {
                                    if (parent->getName() == name) {
                                        return parent;
                                    }
                                    parent = parent->getParent();
                                }
                            }
                        }
                    }
                    return nullptr;
                }*/
    
                void Grid::createCell (math::Vec3f &point) {
                    //std::cout<<"point : "<<point<<std::endl;
                    math::Vec3f coordsCaseP = getCoordinatesAt(point);
                    //std::cout<<"coords caseP : "<<coordsCaseP<<std::endl;
    
                    /*minX = (coordsCaseP.x < minX) ? coordsCaseP.x : minX;
                    minY = (coordsCaseP.y < minY) ? coordsCaseP.y : minY;
                    minZ = (coordsCaseP.z < minZ) ? coordsCaseP.z : minZ;
                    maxX = (coordsCaseP.x > maxX) ? coordsCaseP.x : maxX;
                    maxY = (coordsCaseP.y > maxY) ? coordsCaseP.y : maxY;
                    maxZ = (coordsCaseP.z > maxZ) ? coordsCaseP.z : maxZ;*/
    
                    math::Vec3f p = bm.unchangeOfBase(point);
    
                    math::Vec3f v1;
                    v1.x = (cellWidth > 0) ? (int) p.x / cellWidth : 0;
                    v1.y = (cellHeight > 0) ? (int) p.y / cellHeight : 0;
                    v1.z = (cellDepth > 0) ? (int) p.z / cellDepth : 0;
                    if (p.x <= 0)
                        v1.x--;
                    if (p.y <= 0)
                        v1.y--;
                    if (p.z <= 0)
                        v1.z--;
                    v1.x *= cellWidth;
                    v1.y *= cellHeight;
                    v1.z *= cellDepth;
                    math::Vec3f v[8];
                    v[0] = math::Vec3f (v1.x, v1.y, v1.z);
                    v[1] = math::Vec3f (v1.x + cellWidth, v1.y, v1.z);
                    v[2] = math::Vec3f (v1.x + cellWidth, v1.y + cellHeight, v1.z);
                    v[3] = math::Vec3f (v1.x, v1.y + cellHeight, v1.z);
                    v[4] = math::Vec3f (v1.x, v1.y, v1.z+cellDepth);
                    v[5] = math::Vec3f (v1.x + cellWidth, v1.y, v1.z+cellDepth);
                    v[6] = math::Vec3f (v1.x + cellWidth, v1.y + cellHeight, v1.z+cellDepth);
                    v[7] = math::Vec3f (v1.x, v1.y + cellHeight, v1.z+cellDepth);
    
                    for (unsigned int i = 0; i < 8; i++) {
                        v[i] = bm.changeOfBase(v[i]);
                        /*if (i < 4)
                            std::cout<<"point "<<i<<" : "<<v[i]<<std::endl;*/
                    }
    
                    //Face de devant.
                    physic::BoundingPolyhedron bp(v[0], v[1], v[2], true);
                    bp.addTriangle(v[0], v[2], v[3]);
                    //Face gauche.
                    bp.addTriangle(v[0], v[1], v[7]);
                    bp.addTriangle(v[0], v[3], v[7]);
                    //Face droite.
                    bp.addTriangle(v[1], v[5], v[6]);
                    bp.addTriangle(v[1], v[2], v[6]);
                    //Face de derrière.
                    bp.addTriangle(v[4], v[5], v[6]);
                    bp.addTriangle(v[4], v[7], v[6]);
                    //Face du dessus.
                    bp.addTriangle(v[0], v[4], v[5]);
                    bp.addTriangle(v[0], v[1], v[5]);
                    //Face du dessous.
                    bp.addTriangle(v[3], v[7], v[6]);
                    bp.addTriangle(v[3], v[2], v[6]);
                    //std::cout<<"center : "<<bp->getCenter()<<std::endl;
                    Cell *cell = new Cell(bp, coordsCaseP);
                    cells.push_back(cell);
                    checkExts();
                    cells.pop_back();
    
                    nbCellsPerRow = (cellWidth > 0) ? math::Math::abs(minX) + maxX + 1 : 1;
                    nbCellsPerCol = (cellHeight > 0) ? math::Math::abs(minY) + maxY + 1 : 1;
                    int nbCellsPerDepth = (cellDepth > 0) ? math::Math::abs(minZ) + maxZ + 1 : 1;
                    //std::cout<<"nbCellsPerRow : "<<nbCellsPerRow<<std::endl<<"nbCellsPerCol : "<<nbCellsPerCol<<"nb Cells per depth"<<nbCellsPerDepth<<std::endl;
                    unsigned int newSize = nbCellsPerCol * nbCellsPerRow * nbCellsPerDepth;
                    //std::cout<<"min z : "<<minZ<<std::endl;
                    int indice = (math::Math::abs(minX) + coordsCaseP.x)
                                 + (math::Math::abs(minY) + coordsCaseP.y) * nbCellsPerRow + (math::Math::abs(minZ) + coordsCaseP.z) * nbCellsPerCol;
                    //std::cout<<"create cell map at indice : "<<indice<<std::endl;
                    if (newSize > cells.size()) {
                        //std::cout<<"resize vector! : "<<newSize<<std::endl;
                        vector<Cell*> tmpCells = cells;
                        cells.clear();
                        cells.resize(newSize);
                        std::fill(cells.begin(), cells.end(), nullptr);
                        for (unsigned int i = 0; i < tmpCells.size(); i++) {
                            if (tmpCells[i] != nullptr) {
                                math::Vec3f coords = tmpCells[i]->getCoords();
                                int newInd = (math::Math::abs(minX) + coords.x)
                                             + (math::Math::abs(minY) + coords.y) * nbCellsPerRow + (math::Math::abs(minZ) + coords.z) * nbCellsPerCol;
                                //std::cout<<"new ind  : "<<newInd<<std::endl;
                                cells[newInd] = tmpCells[i];
                            }
                        }
                    } else if (newSize < cells.size()) {
                        //std::cout<<"resize vector! : "<<newSize<<std::endl;
                        vector<Cell*> tmpCells = cells;
                        cells.clear();
                        cells.resize(newSize);
                        std::fill(cells.begin(), cells.end(), nullptr);
                        for (unsigned int i = 0; i < tmpCells.size(); i++) {
                            if (tmpCells[i] != nullptr) {
                                math::Vec3f coords = tmpCells[i]->getCoords();
                                int newInd = (math::Math::abs(minX) + coords.x)
                                             + (math::Math::abs(minY) + coords.y) * nbCellsPerRow + (math::Math::abs(minZ) + coords.z) * nbCellsPerCol;
                                //std::cout<<"new ind  : "<<newInd<<std::endl;
                                cells[newInd] = tmpCells[i];
                            }
                        }
                    }
                    //std::cout<<"ind : "<<indice<<std::endl;
                    cells[indice] = cell;
                    //system("PAUSE");
                }
    
    
                //Supprime une tile dans la cellule. (Sans la supprimer de la mémoire.)
                bool Grid::removeEntity (physic::BoundingBox globalBounds, EntityId entity) {
    
                    int x = globalBounds.getPosition().x;
                    int y = globalBounds.getPosition().y;
                    int z = globalBounds.getPosition().z;
                    int endX = (x + globalBounds.getWidth());
                    int endY = (y + globalBounds.getHeight());
                    int endZ = (z + globalBounds.getDepth());
                    bool removed = false;
                    for (int i = x; i <= endX; i+= offsetX) {
                        for (int j = y; j <= endY; j+= offsetY) {
                            for (int k = z; k <= endZ; k+= offsetZ) {
                                math::Vec3f pos (i, j, k);
                                Cell *cm = getGridCellAt(pos);
                                math::Vec3f coords = getCoordinatesAt(pos);
                                int indice = (math::Math::abs(minX) + coords.x)
                                            + (math::Math::abs(minY) + coords.y) * nbCellsPerRow + (math::Math::abs(minZ) + coords.z) * nbCellsPerCol;
                                //std::cout<<"remove entity indice : "<<indice<<std::endl<<"mins : "<<std::endl<<minX<<","<<minY<<","<<minZ<<std::endl<<"maxs : "<<maxX<<","<<maxY<<","<<maxZ<<std::endl<<"nb Cells : "<<nbCellsPerRow<<","<<nbCellsPerCol<<std::endl<<"coords : "<<coords<<"size : "<<cells.size()<<std::endl;
                                if (cm != nullptr) {
                                  /*if (i == x && j == y && k == z && entity->getType() == "E_TILE") {
                                      int indice = (math::Math::abs(minX) + cm->getCoords().x)
                                            + (math::Math::abs(minY) + cm->getCoords().y) * nbCellsPerRow + (math::Math::abs(minZ) + cm->getCoords().z) * nbCellsPerCol;
                                  }*/
                                  if(cm->removeEntity(entity)) {
                                    removed = true;
                                  }
                                  if (!cm->isEntityInside())
                                        removeCell(cm);
                                }
                            }
                        }
                    }
                    return removed;
                }
                void Grid::removeCell (Cell *cell) {
    
                    for (unsigned int i = 0; i < cells.size(); i++) {
                        if (cells[i] != nullptr && cells[i]==cell) {
                            //std::cout<<"delete cell : "<<cells[i]->getCoords()<<std::endl;
                            delete cells[i];
                            cells[i] = nullptr;
                        }
                    }
                    //Supprime les Cells vides à la fin du vecteur.
                    //On recherche les coordonnées de la case la plus grande.
                    checkExts();
                    //On cherche si il faut réduire la taille du vecteur. (En partant du début.)
                    nbCellsPerRow = (cellWidth > 0) ? math::Math::abs(minX) + maxX + 1 : 1;
                    nbCellsPerCol = (cellHeight > 0) ? math::Math::abs(minY) + maxY + 1 : 1;
                    int nbCellsPerDepth = (cellDepth > 0) ? math::Math::abs(minZ) + maxZ + 1 : 1;
                    unsigned int newSize = nbCellsPerCol * nbCellsPerRow * nbCellsPerDepth;
    
                    if (newSize < cells.size()) {
                        //std::cout<<"new size : "<<newSize<<std::endl;
                        vector<Cell*> tmpcells = cells;
                        cells.clear();
                        cells.resize(newSize);
                        std::fill(cells.begin(), cells.end(), nullptr);
                        for (unsigned int i = 0; i < tmpcells.size(); i++) {
                            if (tmpcells[i] != nullptr) {
                                math::Vec3f coords = tmpcells[i]->getCoords();
                                int newInd = math::Math::abs(minX) + coords.x + (math::Math::abs(minY) + coords.y) * nbCellsPerRow + (math::Math::abs(minZ) + coords.z) * nbCellsPerCol;
                                cells[newInd] = tmpcells[i];
                            }
                        }
                    } else if (newSize > cells.size()) {
                        //std::cout<<"new size : "<<newSize<<std::endl;
                        vector<Cell*> tmpcells = cells;
                        cells.clear();
                        cells.resize(newSize);
                        std::fill(cells.begin(), cells.end(), nullptr);
                        for (unsigned int i = 0; i < tmpcells.size(); i++) {
                            if (tmpcells[i] != nullptr) {
                                math::Vec3f coords = tmpcells[i]->getCoords();
                                int newInd = math::Math::abs(minX) + coords.x + (math::Math::abs(minY) + coords.y) * nbCellsPerRow + (math::Math::abs(minZ) + coords.z) * nbCellsPerCol;
                                cells[newInd] = tmpcells[i];
                            }
                        }
                    }
                }
    
                vector<Cell*> Grid::getCellsInBox (physic::BoundingBox bx) {
    
                    vector<Cell*> cells;
                    int x = bx.getPosition().x;
                    int y = bx.getPosition().y;
                    int z = bx.getPosition().z;
                    int endX = (x + bx.getWidth());
                    int endY = (y + bx.getHeight());
                    int endZ = (z + bx.getDepth());
                    for (int i = x; i <= endX; i+= offsetX) {
                        for (int j = y; j <= endY; j+= offsetY) {
                            for (int k = 0; k <= endZ; k+= offsetZ) {
                                math::Vec3f p (i, j, k);
                                Cell *cell = getGridCellAt(p);
                                if (cell != nullptr) {
                                    bool contains = false;
                                    for (unsigned int i = 0; i < cells.size(); i++) {
                                        if (cells[i] == cell)
                                            contains = true;
                                    }
                                    if (!contains)
                                        cells.push_back(cell);
                                }
                            }
                        }
                    }
                    return cells;
                }
    
                /*vector<EntityId> Grid::getEntitiesInBox(ComponentMapping mapping, physic::BoundingBox box) {
                    vector<EntityId> entities;
                    int x = box.getPosition().x;
                    int y = box.getPosition().y;
                    int z = box.getPosition().z;
                    int endX = box.getPosition().x + box.getWidth();
                    int endY = box.getPosition().y + box.getHeight();
                    int endZ = box.getPosition().z + box.getDepth();
                    physic::BoundingBox bx (x, y, z, endX-x, endY-y, z - endZ);
                    for (int i = x; i <= endX; i+=offsetX) {
                        for (int j = y; j <= endY; j+=offsetY) {
                            for (int k = z; k <= endZ; k+= offsetZ) {
                                math::Vec3f point(i, j, k);
                                Cell* cell = getGridCellAt(point);
                                if (cell != nullptr) {
                                    for (unsigned int n = 0; n < cell->getEntitiesInside().size(); n++) {
                                       Entity* entity = cell->getEntityInside(n);
                                       bool contains = false;
                                       for (unsigned int k = 0; k < entities.size() && !contains; k++) {
                                            if (entities[k] == entity)
                                                contains = true;
                                       }
                                       if (!contains && bx.intersects(globalBounds) || bx.isInside(globalBounds) || globalBounds.isInside(bx)) {
    
                                            entities.push_back(entity);
                                       }
                                    }
                                }
                            }
                        }
                    }
                    return entities;
                }*/
    
                vector<EntityId> Grid::getEntities () {
                    vector<EntityId> allEntities;
                    for (unsigned int i = 0; i < cells.size(); i++) {
                        Cell *cell = cells[i];
                        if (cell != nullptr) {
                             for (unsigned int n = 0; n < cell->getNbEntitiesInside(); n++) {
                                bool contains = false;
                                for (unsigned int j = 0; j < allEntities.size(); j++) {
                                    if (allEntities[j].get().load() == cell->getEntityInside(n).get().load())
                                        contains = true;
                                }
                                if (!contains) {
                                    allEntities.push_back(cell->getEntityInside(n));
                                }
                            }
                        }
                    }
                    return allEntities;
                }
    
                math::Vec3f Grid::getMins () {
                    return math::Vec3f(minX, minY, minZ);
                }
    
                Cell* Grid::getGridCellAt (math::Vec3f point) {
                    math::Vec3f coordsCaseP = getCoordinatesAt(point);
                    unsigned int indice = (math::Math::abs(minX) + coordsCaseP.x) + (math::Math::abs(minY) + coordsCaseP.y) * nbCellsPerRow + (math::Math::abs(minZ) + coordsCaseP.z) * nbCellsPerCol;
                    //std::cout<<"get cell map at "<<point<<coordsCaseP<<minX<<std::endl<<"miny : "<<minY<<std::endl<<"minz : "<<minZ<<std::endl<<"nb Cells per row : "<<nbCellsPerRow<<std::endl<<"nb Cells per col : "<<nbCellsPerCol<<std::endl<<indice<<std::endl;
                    if (indice >= 0 && indice < cells.size()) {
                        return cells[indice];
                    }
                    return nullptr;
                }
    
                math::Vec3f Grid::getCoordinatesAt(math::Vec3f &point) {
                    //std::cout<<"get coordinates at, point : "<<point<<std::endl;
                    math::Vec3f p = bm.unchangeOfBase(point);
                    //std::cout<<"p : "<<p<<std::endl;
                    math::Vec3f f;
                    if (cellWidth > 0)
                        f.x = (int) p.x / cellWidth;
                    else
                        f.x = 0;
                    if (cellHeight > 0)
                        f.y = (int) p.y / cellHeight;
                    else
                        f.y = 0;
                    if (cellDepth > 0)
                        f.z = (int) p.z / cellDepth;
                    else
                        f.z = 0;
                    if (p.x <= 0 && cellWidth > 0)
                        f.x--;
                    if (p.y <= 0 && cellHeight > 0)
                        f.y--;
                    if (p.z <= 0 && cellDepth > 0)
                        f.z--;
                    //std::cout<<"coordinates at : "<<point<<f<<std::endl;
                    return f;
                }
    
                std::vector<Cell*> Grid::getCells () {
                    return cells;
                }
                void Grid::checkExts () {
                    //std::cout<<"mins : "<<minX<<","<<minY<<","<<minZ<<std::endl<<"maxs : "<<maxX<<","<<maxY<<","<<maxZ<<std::endl;
                    minX = minY = minZ = std::numeric_limits<int>::max();
                    maxX = maxY = maxZ = std::numeric_limits<int>::min();
                    unsigned int nbCells=0;
                    for (unsigned int i = 0; i < cells.size(); i++) {
                        if (cells[i] != nullptr) {
                            math::Vec3f point = cells[i]->getCellVolume().getCenter();
                            math::Vec3f coordsCaseP = getCoordinatesAt(point);
                            //std::cout<<"coordsCaseP : "<<coordsCaseP<<std::endl;
                            minX = (coordsCaseP.x < minX) ? coordsCaseP.x : minX;
                            minY = (coordsCaseP.y < minY) ? coordsCaseP.y : minY;
                            minZ = (coordsCaseP.z < minZ) ? coordsCaseP.z : minZ;
                            maxX = (coordsCaseP.x > maxX) ? coordsCaseP.x : maxX;
                            maxY = (coordsCaseP.y > maxY) ? coordsCaseP.y : maxY;
                            maxZ = (coordsCaseP.z > maxZ) ? coordsCaseP.z : maxZ;
                            nbCells++;
                        }
                    }
                    if (nbCells == 0) {
                        minX = minY = minZ = maxX = maxY = maxZ = 0;
                    }
                    //std::cout<<"mins : "<<minX<<","<<minY<<","<<minZ<<std::endl<<"maxs : "<<maxX<<","<<maxY<<","<<maxZ<<std::endl;
                    //system("PAUSE");
                }
    
                math::Vec3f Grid::getSize() {
                    return math::Vec3f (maxX - minX, maxY - minY, maxZ - minZ);
                }
    
                Cell* Grid::getGridCellAtFromCoords(math::Vec3f coords) {
                    int indice = (math::Math::abs(minX) + coords.x) + (math::Math::abs(minY) + coords.y) * nbCellsPerRow + (math::Math::abs(minZ) + coords.z) * nbCellsPerCol;
                    if (indice >= 0 && indice < static_cast<int>(cells.size()))
                        return cells[indice];
                    return nullptr;
                }
    
                Grid::~Grid () {
                    for (unsigned int i = 0; i < cells.size(); i++) {
                         if (cells[i] != nullptr)
                            delete cells[i];
                    }
                    cells.clear();
                }
            }
        }
    }

    Mais j'ai des erreurs à l'écition des liens comme quoi il ne trouve pas la définition des méthodes de cette class :

    /usr/bin/ld : 
    obj/Debug/gitODFAEG/Demos/ODFAEGECSDemo/main.o : dans la fonction « odfaeg::graphic::ecs::SceneGridComponent::SceneGridComponent() » :
    /home/laurent/gitODFAEG/Demos/ODFAEGECSDemo/../../ODFAEG/include/odfaeg/Graphics/ECS/components.hpp:26 : référence indéfinie vers « odfaeg::graphic::ecs::Grid::Grid(int, int, int) »
    /usr/bin/ld : obj/Debug/gitODFAEG/Demos/ODFAEGECSDemo/main.o : dans la fonction « odfaeg::graphic::ecs::SceneGridComponent::~SceneGridComponent() » :
    /home/laurent/gitODFAEG/Demos/ODFAEGECSDemo/../../ODFAEG/include/odfaeg/Graphics/ECS/components.hpp:26 : référence indéfinie vers « odfaeg::graphic::ecs::Grid::~Grid() »
    /usr/bin/ld : obj/Debug/gitODFAEG/Demos/ODFAEGECSDemo/main.o : dans la fonction « auto odfaeg::graphic::ecs::ModelFactory::createGridSceneModel<odfaeg::graphic::ecs::World<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, odfaeg::core::DynamicTuple<>, odfaeg::graphic::ecs::EntityFactory>(odfaeg::graphic::ecs::World<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, odfaeg::core::DynamicTuple<>&, odfaeg::graphic::ecs::EntityFactory&, odfaeg::graphic::ecs::atomwrapper<unsigned long*>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, unsigned int, unsigned int) » :
    /home/laurent/gitODFAEG/Demos/ODFAEGECSDemo/../../ODFAEG/include/odfaeg/Graphics/ECS/modelFactory.hpp:280 : référence indéfinie vers « odfaeg::graphic::ecs::Grid::Grid(int, int, int) »
    /usr/bin/ld : /home/laurent/gitODFAEG/Demos/ODFAEGECSDemo/../../ODFAEG/include/odfaeg/Graphics/ECS/modelFactory.hpp:285 : référence indéfinie vers « odfaeg::graphic::ecs::Grid::~Grid() »
    /usr/bin/ld : /home/laurent/gitODFAEG/Demos/ODFAEGECSDemo/../../ODFAEG/include/odfaeg/Graphics/ECS/modelFactory.hpp:285 : référence indéfinie vers « odfaeg::graphic::ecs::Grid::~Grid() »
    /usr/bin/ld : obj/Debug/gitODFAEG/Demos/ODFAEGECSDemo/main.o : dans la fonction « bool odfaeg::graphic::ecs::AddEntityToSceneSystem::operator()<odfaeg::graphic::ecs::SceneGridComponent*, std::tuple<odfaeg::core::DynamicTuple<odfaeg::graphic::ecs::TransformComponent, odfaeg::graphic::ecs::MeshComponent, odfaeg::graphic::ecs::ClonableComponent, odfaeg::graphic::ecs::EntityInfoComponent>, odfaeg::graphic::ecs::ComponentMapping, odfaeg::graphic::ecs::atomwrapper<unsigned long*>, odfaeg::graphic::ecs::atomwrapper<unsigned long*>*, odfaeg::graphic::ecs::atomwrapper<unsigned long*>*, odfaeg::graphic::ecs::atomwrapper<unsigned long*>*, bool>, void>(std::tuple<odfaeg::graphic::ecs::SceneGridComponent*>, odfaeg::graphic::ecs::atomwrapper<unsigned long*>, std::tuple<odfaeg::core::DynamicTuple<odfaeg::graphic::ecs::TransformComponent, odfaeg::graphic::ecs::MeshComponent, odfaeg::graphic::ecs::ClonableComponent, odfaeg::graphic::ecs::EntityInfoComponent>, odfaeg::graphic::ecs::ComponentMapping, odfaeg::graphic::ecs::atomwrapper<unsigned long*>, odfaeg::graphic::ecs::atomwrapper<unsigned long*>*, odfaeg::graphic::ecs::atomwrapper<unsigned long*>*, odfaeg::graphic::ecs::atomwrapper<unsigned long*>*, bool>&) » :
    /home/laurent/gitODFAEG/Demos/ODFAEGECSDemo/../../ODFAEG/include/odfaeg/Graphics/ECS/systems.hpp:571 : référence indéfinie vers « odfaeg::graphic::ecs::Grid::addEntity(odfaeg::physic::BoundingBox, odfaeg::graphic::ecs::atomwrapper<unsigned long*>) »
    collect2: error: ld returned 1 exit status
    Process terminated with status 1 (0 minute(s), 3 second(s))
    1 error(s), 108 warning(s) (0 minute(s), 3 second(s))
     

    Pourquoi ?

    Merci!



    -
    Edité par OmbreNoire 14 août 2022 à 13:39:38

    • Partager sur Facebook
    • Partager sur Twitter
      14 août 2022 à 13:55:53

      Salut,

      Ben, à lire le message d'erreur, il semblerait que l'éditeur de lien ne trouve tout simplement pas l'implémentation finale des différentes fonction de ta classe Grid...

      Es tu sur que ton fichier grid.cpp (si c'est bel et bien le nom) a été compilé, et que le fichier objet généré a été ajouté à la liste des fichiers utilisés lors de l'édition de liens?

      -
      Edité par koala01 14 août 2022 à 13:56:33

      • Partager sur Facebook
      • Partager sur Twitter
      Ce qui se conçoit bien s'énonce clairement. Et les mots pour le dire viennent aisément.Mon nouveau livre : Coder efficacement - Bonnes pratiques et erreurs  à éviter (en C++)Avant de faire ce que tu ne pourras défaire, penses à tout ce que tu ne pourras plus faire une fois que tu l'auras fait
        14 août 2022 à 14:05:50

        Salut, le fichier est dans une librairie pourtant je link bien la librairie à l'édiction de lien :

        bref je ne comprend pas je n'ai jamais eu ce problème.

        -
        Edité par OmbreNoire 14 août 2022 à 14:06:07

        • Partager sur Facebook
        • Partager sur Twitter
          14 août 2022 à 14:08:52

          Mais est ce que le fichier .cpp est bien dans la liste des fichiers qui doivent être générés pour créer ta lib?

          Il est tellement simple avec code::blocks d'avoir un fichier qui n'est pas ajouté au projet que la première chose qu'il faut vérifier, c'est : est ce que ce fichier sera correctement généré lorsque je compilerai le projet ;)

          • Partager sur Facebook
          • Partager sur Twitter
          Ce qui se conçoit bien s'énonce clairement. Et les mots pour le dire viennent aisément.Mon nouveau livre : Coder efficacement - Bonnes pratiques et erreurs  à éviter (en C++)Avant de faire ce que tu ne pourras défaire, penses à tout ce que tu ne pourras plus faire une fois que tu l'auras fait
            14 août 2022 à 14:13:49

            Ah c'était ça le fichier n'était pas ajouté à cmake donc n'était pas compilé.

            Résolu.

            -
            Edité par OmbreNoire 14 août 2022 à 14:14:17

            • Partager sur Facebook
            • Partager sur Twitter

            Erreur à l'édition des liens

            × 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