IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++ Discussion :

Mingw ne trouve pas ma classe!


Sujet :

C++

  1. #1
    Invité
    Invité(e)
    Par défaut Mingw ne trouve pas ma classe!
    Salut j'ai un header contenant deux classe :
    Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
     
    #ifndef ODFAEG_BOUNDING_VOLUME_HPP
    #define ODFAEG_BOUNDING_VOLUME_HPP
    #include "../Math/vec4.h"
    #include "../Math/ray.h"
    #include <string>
    #include <iostream>
    #include "collisionResultSet.hpp"
    /**
      *\namespace odfaeg
      * the namespace of the Opensource Development Framework Adapted for Every Games.
      */
    namespace odfaeg {
        namespace physic {
            /**
              * \file boundingVolume.h
              * \class BoudingVolume
              * \brief Manage a bounding volume for collision detection
              * \author Duroisin.L
              * \version 1.0
              * \date 1/02/2014
              *
              * Base class of all bouding volumes of the framework used for collision detection.
              *
              */
            class BoundingVolume;
            class BoundingBox;
            class OrientedBoundingBox;
            class BoundingSphere;
            class BoundingEllipsoid;
            class BoundingPolyhedron;
            class BaseInterface {
                 public :
                 virtual bool onIntersects(BaseInterface& other, CollisionResultSet::Info& infos) = 0;
                 virtual bool onIntersects(BaseInterface& bi, math::Ray& ray, bool segment, CollisionResultSet::Info& infos) = 0;
                 virtual bool onIntersects(BaseInterface& bi, math::Ray& ray, math::Vec3f& near, math::Vec3f& far, CollisionResultSet::Info& infos) = 0;
                 virtual bool intersects (BoundingBox &bb, CollisionResultSet::Info& infos) = 0;
                 virtual bool intersects (BoundingSphere &bs, CollisionResultSet::Info& infos) = 0;
                 virtual bool intersects (BoundingEllipsoid &be, CollisionResultSet::Info& infos) = 0;
                 virtual bool intersects (OrientedBoundingBox &ob, CollisionResultSet::Info& infos) = 0;
                 virtual bool intersects (BoundingPolyhedron &bp, CollisionResultSet::Info& infos) = 0;
                 virtual bool intersects (math::Ray& ray, bool segment, CollisionResultSet::Info& infos) = 0;
                 virtual bool intersectsWhere (math::Ray& ray, math::Vec3f& near, math::Vec3f& far, CollisionResultSet::Info& infos) = 0;
                 std::vector<BoundingVolume*> getChildren();
                 std::vector<std::unique_ptr<BoundingVolume>> children;
            };
            class BoundingVolume : public BaseInterface, public core::Registered<BoundingVolume> {
            public :
                BoundingVolume ();
                void addChild(BoundingVolume* bv);
                bool intersects(BaseInterface& other, CollisionResultSet::Info& info);
                bool intersects(math::Ray& ray, bool segment, CollisionResultSet::Info& info);
                bool intersectsWhere(math::Ray& ray, math::Vec3f& near, math::Vec3f& far, CollisionResultSet::Info& info);
                virtual math::Vec3f getPosition() = 0;
                virtual math::Vec3f getSize() = 0;
                virtual math::Vec3f getCenter() = 0;
                virtual void move (math::Vec3f t) = 0;
                virtual std::unique_ptr<BoundingVolume> clone () = 0;
                template <typename Archive>
                void vtserialize(Archive & ar);
                virtual ~BoundingVolume() {}
                protected :
                BoundingVolume(const BoundingVolume& other);
                BoundingVolume& operator= (const BoundingVolume& other);
            };
        }
    }
    #include "../../../src/odfaeg/Physics/boundingVolume.tpp"
    #endif // BOUNDING_AREAS

    Et un autre header qui utilise ces deux classes :

    Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
     
    #ifndef ODFAEG_BOUNDING_BOX_HPP
    #define ODFAEG_BOUNDING_BOX_HPP
    #include "../Math/vec2f.h"
    #include "../Math/ray.h"
    #include <climits>
    #include "boundingVolume.h"
    #include "../Math/computer.h"
    /**
      *\namespace odfaeg
      * the namespace of the Opensource Development Framework Adapted for Every Games.
      */
    namespace odfaeg {
        namespace graphic {
            class TransformMatrix;
        }
        namespace physic {
            class BoundingSphere;
            class BoundingEllipsoid;
            class OrientedBoundingBox;
            class BoundingPolyhedron;
     
            /**
              * \file boundingBox.h
              * \class BoudingBox
              * \brief Manage a bounding box for collision detection
              * \author Duroisin.L
              * \version 1.0
              * \date 1/02/2014
              *
              * Manage a bounding box for collision detection.
              * The bounding box is aligned with the x and y axis.
              *
              */
            class BoundingBox : public BoundingVolume {
                public :
                    /** \fn BoundingBox()
                    * \brief Default constructor (initialize a bounding retangle at position (0, 0) and with a size of (0, 0).
                    */
                    BoundingBox ();
                    /** \fn BoundingBox (int, int, int, int  int, int)
                     * \brief Initialize a bounding box with the given position and the given size
                     * \param the x position of the bounding box
                     * \param the y position of the bounding box
                     * \param the z position of the bounding box
                     * \param the width of the bounding box
                     * \param the height of the bounding box
                     * \param the depth of the bounding box
                     */
                    BoundingBox (int x, int y, int z, int width, int height, int depth);
                    /** \fn bool intersects (BoundingSphere &bs)
                    *   \brief test if a bounding sphere collides with the bounding sphere.
                    *   \param the bounding sphere to test with.
                    *   \return the result of the collision test.
                    */
                    bool onIntersects (BaseInterface& interface, CollisionResultSet::Info& info);
                    bool onIntersects (BaseInterface& interface, math::Ray& ray, bool segment, CollisionResultSet::Info& info);
                    bool onIntersects (BaseInterface& interface, math::Ray& ray, math::Vec3f& near, math::Vec3f& far, CollisionResultSet::Info& info);
                    bool intersects (BoundingBox& bx);
                    bool intersects (BoundingVolume &bv, CollisionResultSet::Info& info);
                    bool intersects (BoundingSphere &bs, CollisionResultSet::Info& info);
                    /** \fn bool intersects (BoundingEllipsoid &be)
                    *   \brief test if a bounding ellipsoid collides with the bounding box.
                    *   \param the bounding ellipsoid to test with.
                    *   \return the result of the collision test.
                    */
                    bool intersects (BoundingEllipsoid &bc, CollisionResultSet::Info& info);
                    /** \fn bool intersects (BoundingBox &br)
                    *   \brief test if an other bounding box collides with the bounding box.
                    *   \param the other bounding box to test with.
                    *   \return the result of the collision test.
                    */
                    bool intersects (BoundingBox &bx, CollisionResultSet::Info& info);
                    /** \fn bool intersects (OrientedBoundingBox &br)
                    *   \brief test if an oriented bounding sphere collides with the bounding box.
                    *   \param the oriented bounding box to test with.
                    *   \return the result of the collision test.
                    */
                    bool intersects (OrientedBoundingBox &obx, CollisionResultSet::Info& info);
                    /** \fn bool intersects (BoundingPolyhedron &bp)
                    *   \brief test if a bounding polyhedron collides with the bounding box.
                    *   \param the bounding polyhedron to test with.
                    *   \return the result of the collision test.
                    */
                    bool intersects (BoundingPolyhedron &bp, CollisionResultSet::Info& info);
                    /** \fn bool intersects (Ray &ray)
                    *   \brief test if a ray collides with the bounding box.
                    *   \param the Segment to test with.
                    *   \return the result of the collision test.
                    */
                    bool intersects (math::Ray& ray, bool segment, CollisionResultSet::Info& info);
                    bool intersectsWhere (math::Ray &ray, math::Vec3f& i1, math::Vec3f& i2, CollisionResultSet::Info& info);
                    /** \fn bool isPointInside (Vec2f point)
                    *   \brief test if a point is in the bounding box.
                    *   \param the point to test in.
                    *   \return the result of the collision test.
                    */
                    bool isPointInside (math::Vec3f point);
                    /**\fn Vec2f getCenter()
                    *  \brief gives the center of the bounding box.
                    *  \return the center of the bounding box.
                    */
                    math::Vec3f getCenter();
                   /**\fn float getWidth()
                    *  \brief gives the width of the bounding box.
                    *  \return the width of the bounding box.
                    */
                    float getWidth();
                    /**\fn float getHeight()
                    *  \brief gives the height of the bounding box.
                    *  \return the height of the bounding box.
                    */
                    float getHeight();
                    /**\fn float getDepth()
                    *  \brief gives the depth of the bounding box.
                    *  \return the depth of the bounding box.
                    */
                    float getDepth();
                    /**\fn Vec3f getPosition()
                    *  \brief gives the position of the bounding box.
                    *  \return the position of the bounding box.
                    */
                    math::Vec3f getSize();
                    math::Vec3f getPosition();
                    /**\fn void setPosition(int x, int y, int z)
                    *  \brief set the position of the bounding box.
                    *  \param the x position of the bounding box.
                    *  \param the y position of the bounding box.
                    */
                    void setPosition(int x, int y, int z);
                    /**\fn void setSize(int width, int height, int depth)
                    *  \brief set the size of the bounding box.
                    *  \param the width of the bounding box.
                    *  \param the height of the bounding box.
                    *  \param the depth of the bounding box.
                    */
                    void setSize(int width, int height, int depth);
                    void move (math::Vec3f t);
                    void scale (math::Vec3f s);
                    const BoundingBox& operator= (const BoundingBox& other) {
                        x = other.x;
                        y = other.y;
                        z = other.z;
                        width = other.width;
                        height = other.height;
                        depth = other.depth;
                        points = other.points;
                        return *this;
                    }
                    template <typename Archive>
                    void vtserialize(Archive & ar) {
                        BoundingVolume::vtserialize(ar);
                        ar(x);
                        ar(y);
                        ar(z);
                        ar(width);
                        ar(height);
                        ar(depth);
                        ar(center);
                        ar(edgeBissectors);
                        ar(faceBissectors);
                        ar(edgeNormals);
                        ar(faceNormals);
                    }
                    BoundingBox transform(graphic::TransformMatrix &tm);
                    std::unique_ptr<BoundingVolume> clone() {
                        return std::make_unique<BoundingBox>(*this);
                    }
                    std::vector<math::Vec3f> getVertices();
                    std::vector<math::Vec3f> getFaceNormals();
                    std::vector<math::Vec3f> getEdgeNormals();
                    std::vector<math::Vec3f> getFaceBissectors();
                    std::vector<math::Vec3f> getEdgeBissectors();
                    bool isFlat();
                private :
                    void computeVectors();
                    std::vector<math::Vec3f> points;
                    std::vector<math::Vec3f> faceNormals;
                    std::vector<math::Vec3f> edgeNormals;
                    std::vector<math::Vec3f> faceBissectors;
                    std::vector<math::Vec3f> edgeBissectors;
                    bool flat;
                    int x, y, z, width, height, depth; /**< the x position of the bounding box */
                    /**< the y position of the bounding box */
                    /**< the z position of the bounding box */
                    /**< the width of the bounding box */
                    /**< the height of the bounding box */
                    /**< the depth of the bounding box */
                    math::Vec3f center;
                    /**< the center of the bounding box */
            };
        }
    }
    #endif

    J'ai cette erreur-ci comme quoi il ne trouve pas ma classe BaseInterface :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    C:\Users\Laurent\Developpement\Projets-c++\ODFAEG\src\odfaeg\Network\..\..\..\include\odfaeg\Core\..\Graphics\..\Physics\boundingBox.h|55|error: expected ',' or '...' before 'struct'|
    Or que sous linux ça compile sans problème alors quel est la différence avec le compilateur mingw, qu'est ce qui ne va pas dans mon code ?

  2. #2
    Invité
    Invité(e)
    Par défaut
    Quand je remplace cette ligne :
    Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    bool onIntersects (BaseInterface& interface, CollisionResultSet::Info& info);

    Par ceci :
    Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    bool onIntersects (BaseInterface&, CollisionResultSet::Info& info);

    Là ça compile est ce que interface est un mot spécial du c++14 ?

  3. #3
    Expert éminent sénior
    Avatar de koala01
    Homme Profil pro
    aucun
    Inscrit en
    Octobre 2004
    Messages
    11 614
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : aucun

    Informations forums :
    Inscription : Octobre 2004
    Messages : 11 614
    Points : 30 626
    Points
    30 626
    Par défaut
    Citation Envoyé par Laurent7601 Voir le message
    Quand je remplace cette ligne :
    Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    bool onIntersects (BaseInterface& interface, CollisionResultSet::Info& info);

    Par ceci :
    Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    bool onIntersects (BaseInterface&, CollisionResultSet::Info& info);

    Là ça compile est ce que interface est un mot spécial du c++14 ?
    A priori, non...
    Mais n'aurais tu pas une classe ou une structure nommée de la sorte dans les fichiers d'en-tête inclus (../Math/vec4.h, ../Math/ray.h" ou collisionResultSet.hpp)
    A méditer: La solution la plus simple est toujours la moins compliquée
    Ce qui se conçoit bien s'énonce clairement, et les mots pour le dire vous viennent aisément. Nicolas Boileau
    Compiler Gcc sous windows avec MinGW
    Coder efficacement en C++ : dans les bacs le 17 février 2014
    mon tout nouveau blog

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Mon applet signée ne trouve pas le .class
    Par ptr83 dans le forum Applets
    Réponses: 6
    Dernier message: 24/06/2009, 09h50
  2. Je trouve pas les .class dans mon dossier classes
    Par amine84 dans le forum Eclipse Java
    Réponses: 4
    Dernier message: 15/12/2007, 14h26
  3. [PDO] Ne trouve pas la classe pdo
    Par sliderman dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 07/10/2007, 17h18
  4. Trouve pas mes classes sur le serveur de production
    Par batataw dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 22/09/2007, 12h01
  5. [JAR]Création de Jar -> trouve pas la classe main
    Par Zapan dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 28/01/2006, 11h17

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo