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 :

Compiler avec un compilateur linux sur windows.


Sujet :

C++

  1. #1
    Invité
    Invité(e)
    Par défaut Compiler avec un compilateur linux sur windows.
    Salut, j'ai un projet qui compile sans problème sous linux mais le problème c'est que le driver graphique ne fonctionne pas alors je suis passé sous windows car là je n'ai aucun problème avec le driver graphique, j'ai installé mingw mais j'ai plein d'erreurs en compilation même chose avec visual studio. Alors j'aimerais générer un .exe avec le compilateur linux mais je ne sais pas comment faire, juste pour installer le compilateur linux déjà je ne le trouve pas.

    Salut j'ai ce problème là en compilant avec mingw pourtant ça compile sur linux. :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    C:\Users\Laurent\Developpement\Projets-c++\ODFAEG\src\odfaeg\Core\..\..\..\include\odfaeg\Core\..\Graphics\..\Physics\boundingBox.h|54|error: expected ',' or '...' before 'struct'|
    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
     
    #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
    Dernière modification par Bousk ; 26/12/2018 à 23h59.

  2. #2
    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
    Salut,

    Une question idiote : es-tu sur que tu compile la même version de ton code sous linux et sous windows

    Car, c'est presque un coup "classique" quand on passe d'un OS à l'autre : on oublie de mettre les sources qui seront utilisées à jour par rapport aux dernière modifications qui ont été apportées sur "l'autre OS".

    Ce qui est d'autant plus embêtant que, si on a accès au système de fichier de windows sous linux, l'inverse n'est pas vrai du tout

    Et pour le reste, si cela compile sous linux, et pour autant que tu n'aies pas commencé à inclure des fichiers d'en-tête spécifiques, cela devrait compiler sous windows

    Quant à l'erreur que tu nous montre, es tu sur que c'est bel et bien la toute première erreur qui apparaît, car, à défaut d'avoir effectivement oublié un caractère quelconque une accolade ou une parenthèse fermante, un point-virgule ou autre, c'est -- typiquement -- le genre d'erreur qui apparaît quand le compilateur a déjà perdu les pédales suite à une autre erreur
    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

  3. #3
    Invité
    Invité(e)
    Par défaut
    J'ai réussi à le compiler sous windows mais maintenant j'ai un autre problème avec CMake je spécifie les include :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    include_directories(${OPENSSL_INCLUDE_DIR})
    Mais lorsque je veux compiler le projet j'ai cet erreur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    C:\Users\Laurent\Developpement\Projets-c++\ODFAEG\src\odfaeg\Core\..\..\..\include\odfaeg\Core\..\Network\rsa.h|12|fatal error: openssl/rsa.h: No such file or directory|
    Normalement il doit trouvé le fichier je ne comprend pas pourquoi il ne trouve pas le fichier ....

  4. #4
    Invité
    Invité(e)
    Par défaut
    C'est bon ça compile!

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

Discussions similaires

  1. Equivalent commande Host Linux sur Windows
    Par shadokk dans le forum Windows XP
    Réponses: 6
    Dernier message: 05/01/2011, 14h15
  2. Probleme avec IFRAME et fonction sur window.parent
    Par FadeOut dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 23/10/2006, 09h31
  3. Portage application linux sur windows : pb flex/bison
    Par bludo31 dans le forum Windows
    Réponses: 1
    Dernier message: 01/10/2006, 16h07
  4. [débutant]compiler avec gcc sous linux
    Par Ickou dans le forum Autres éditeurs
    Réponses: 4
    Dernier message: 10/03/2006, 17h27
  5. Problemes de compilation avec g++ sous linux
    Par Selimmel dans le forum Autres éditeurs
    Réponses: 3
    Dernier message: 19/09/2003, 13h43

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