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

Qt Discussion :

Compilation de Qt 5.7.1 depuis Linux pour Windows


Sujet :

Qt

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Février 2014
    Messages
    35
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2014
    Messages : 35
    Par défaut Compilation de Qt 5.7.1 depuis Linux pour Windows
    Bonjour tout le monde,

    Je tente de compiler les sources depuis Linux pour obtenir des bibliothèques partagés au format .dll pour Windows 7 (32 bits).

    J'arrive actuellement a lancer la compilation et a générer mes .so pour ma plateforme Linux mais pas pour Windows.

    Je me suis renseigné sur la cross-compilation de Qt, mais il ne semble pas être possible de faire ce que je veux.

    Voici ce que j'obtiens quand je lance un ls sur le répertoire : qtbase/mkspecs/devices/ (qui contient selon moi, toutes les cibles possible)

    Code : 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
    ls -lart ./qtbase/mkspecs/devices/
    total 104
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-tegra2-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-snowball-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-sh4-stmicro-ST7540-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-sh4-stmicro-ST7108-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-rpi3-vc4-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-rpi3-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-rasp-pi-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-rasp-pi2-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-odroid-xu3-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-nuc-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-mipsel-broadcom-97425-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-jetson-tk1-pro-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-jetson-tk1-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-imx7-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-imx6-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-imx53qsb-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-drive-cx-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-beagleboard-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-arm-trident-pnx8473-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-arm-hisilicon-hix5hd2-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-arm-generic-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-arm-amlogic-8726M-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 linux-archos-gen8-g++
    drwxrwxr-x   2 astro01 astro01 4096 déc.   1 09:17 common
    drwxrwxr-x  26 astro01 astro01 4096 déc.   1 09:17 .
    drwxrwxr-x 100 astro01 astro01 4096 mai   26 00:00 ..
    Est il possible de compiler les sources de Qt5.7.1 depuis Linux pour Windows 7 32 bits ?

    Merci d'avance pour votre aide.

  2. #2
    Responsable Qt & Livres


    Avatar de dourouc05
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2008
    Messages
    26 772
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Août 2008
    Messages : 26 772
    Par défaut


    Et si tu regardes un dossier plus haut (mkspecs plutôt que mkspecs/devices) ?
    Vous souhaitez participer aux rubriques Qt (tutoriels, FAQ, traductions) ou HPC ? Contactez-moi par MP.

    Créer des applications graphiques en Python avec PyQt5
    Créer des applications avec Qt 5.

    Pas de question d'ordre technique par MP !

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Février 2014
    Messages
    35
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2014
    Messages : 35
    Par défaut
    Je te remercie pour ta réponse.

    Effectivement, je n'avais pas regardé ce qu'il y avait dans la dossier parent.

    J'ai vus qu'il y avait un répertoire win32-g++ qui me paraît intéressant.

    J'ai donc copié ce répertoire dans mon répertoire devices afin de pouvoir lancer ma commande :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    configure -device win32-g++
    Mais j'obtiens l'erreur suivante :
    Code : 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
    ./configure -device win32-g++
    + cd qtbase
    + /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/configure -top-level -device win32-g++
    Which edition of Qt do you want to use ?
     
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.
     
    o
     
     
    This is the Qt Open Source Edition.
     
    You are licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) versions 3.
    You are also licensed to use this software under the terms of
    the GNU General Public License (GPL) versions 2.
     
    Type 'L' to view the GNU Lesser General Public License version 3.
    Type 'G' to view the GNU General Public License version 2.
    Type 'yes' to accept this license offer.
    Type 'no' to decline this license offer.
     
    Do you accept the terms of either license? yes
     
    WARNING: Unable to find file /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/mkspecs/devices/win32-g++/../common/angle.conf
    WARNING: Unable to find file /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/mkspecs/devices/win32-g++/../common/angle.conf
    Creating qmake...
    .Done.
    Running configuration tests...
    Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and
    the host's .pc files would be used (even if you set PKG_CONFIG_PATH).
    Set this variable to the directory that contains target .pc files
    for pkg-config to function correctly when cross-compiling or
    use -pkg-config to override this test.
    Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
    Set this variable to your sysroot for pkg-config to function correctly when
    cross-compiling or use -pkg-config to override this test.
     
    Could not determine the target architecture!
    Turn on verbose messaging (-v) to see the final report.
    checking for C++14...  no.
    checking for default C++ standard edition...  no.
    checking for 64-bit std::atomic...  no.
    checking for 64-bit std::atomic in -latomic...  no.
    checking for std::atomic for function pointers...  no.
    ERROR: detected a std::atomic implementation that fails for function pointers.
    Please apply the patch corresponding to your Standard Library vendor, found in
      /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/config.tests/common/atomicfptr
    J'ai également essayé en utilisant -plateform au lieu de -device, mais j'ai l'erreur suivante :
    Code : 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
    configure -platform win32-g++
    + cd qtbase
    + /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/configure -top-level -platform win32-g++
    Which edition of Qt do you want to use ?
     
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.
     
    o
     
     
    This is the Qt Open Source Edition.
     
    You are licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) versions 3.
    You are also licensed to use this software under the terms of
    the GNU General Public License (GPL) versions 2.
     
    Type 'L' to view the GNU Lesser General Public License version 3.
    Type 'G' to view the GNU General Public License version 2.
    Type 'yes' to accept this license offer.
    Type 'no' to decline this license offer.
     
    Do you accept the terms of either license? yes
     
    Creating qmake...
    .g++: error: command line option ‘-fno-keep-inline-dllexport’ is not supported by this configuration
    make: *** [qlibraryinfo.o] Erreur 1
    Visiblement, je ne dois pas avoir un bon g++ ?
    g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  4. #4
    Responsable Qt & Livres


    Avatar de dourouc05
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2008
    Messages
    26 772
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Août 2008
    Messages : 26 772
    Par défaut
    Il te faut effectivement installer un compilateur croisé, ton g++ de base ne suffit pas (il produit des binaires pour ta plateforme).
    Vous souhaitez participer aux rubriques Qt (tutoriels, FAQ, traductions) ou HPC ? Contactez-moi par MP.

    Créer des applications graphiques en Python avec PyQt5
    Créer des applications avec Qt 5.

    Pas de question d'ordre technique par MP !

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Février 2014
    Messages
    35
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2014
    Messages : 35
    Par défaut
    J'ai tenté d'installer un compilateur croisé pour compiler les sources Qt au format PE (windows).

    J'ai installé le paquet suivant :
    sudo apt-get install mingw-w64
    J'ai ensuite fait un lien symbolique dans un répertoire :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    ln -s /usr/bin/x86_64-w64-mingw32-g++-win32 /tmp/compilateur/g++
    export PATH=/tmp/compilateur:$PATH
    J'ai ensuite tenté de relancer la commande (sans succès) :
    Code : 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
    ./configure -platform win32-g++
    + cd qtbase
    + /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/configure -top-level -platform win32-g++
    Which edition of Qt do you want to use ?
     
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.
     
    o
     
     
    This is the Qt Open Source Edition.
     
    You are licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) versions 3.
    You are also licensed to use this software under the terms of
    the GNU General Public License (GPL) versions 2.
     
    Type 'L' to view the GNU Lesser General Public License version 3.
    Type 'G' to view the GNU General Public License version 2.
    Type 'yes' to accept this license offer.
    Type 'no' to decline this license offer.
     
    Do you accept the terms of either license? yes
     
    Creating qmake...
    .qlocale_win.o:qlocale_win.cpp:(.data$_ZZN11QMetaTypeIdIN13QSystemLocale24CurrencyToStringArgumentEE14qt_metatype_idEvE11metatype_id[_ZZN11QMetaTypeIdIN13QSystemLocale24CurrencyToStringArgumentEE14qt_metatype_idEvE11metatype_id]+0x0)*: définitions multiples de «*QMetaTy
    peId<QSystemLocale::CurrencyToStringArgument>::qt_metatype_id()::metatype_id*»
    qlocale.o:(.bss._ZZN11QMetaTypeIdIN13QSystemLocale24CurrencyToStringArgumentEE14qt_metatype_idEvE11metatype_id[_ZZN11QMetaTypeIdIN13QSystemLocale24CurrencyToStringArgumentEE14qt_metatype_idEvE11metatype_id]+0x0)*: défini pour la première fois ici
    qsettings_win.o*: Dans la fonction «*QSettingsPrivate::create(QSettings::Format, QSettings::Scope, QString const&, QString const&)*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/src/corelib/io/qsettings_win.cpp:861*: définitions multiples de «*QSettingsPrivate::create(QSettings::Format, QSettings::Scope, QString const&, QString const&)*»
    qsettings.o:/home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/src/corelib/io/qsettings.cpp:296*: défini pour la première fois ici
    qsettings_win.o*: Dans la fonction «*int QGenericAtomicOps<QAtomicOps<int> >::load<int>(int const&)*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/include/QtCore/../../src/corelib/tools/qlist.h:749*: définitions multiples de «*QSettingsPrivate::create(QString const&, QSettings::Format)*»
    qsettings.o:/home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/include/QtCore/../../src/corelib/tools/qmap.h:341*: défini pour la première fois ici
    qlibraryinfo.o*: Dans la fonction «*QTypedArrayData<char>::deallocate(QArrayData*)*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/include/QtCore/../../src/corelib/tools/qarraydata.h:228*: référence indéfinie vers «*QArrayData::deallocate(QArrayData*, unsigned long long, unsigned long long)*»
    qlibraryinfo.o*: Dans la fonction «*QTypedArrayData<unsigned short>::deallocate(QArrayData*)*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/include/QtCore/../../src/corelib/tools/qarraydata.h:228*: référence indéfinie vers «*QArrayData::deallocate(QArrayData*, unsigned long long, unsigned long long)*»
    qfilesystemengine_win.o*: Dans la fonction «*QFileSystemEngine::id(QFileSystemEntry const&)*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/src/corelib/io/qfilesystemengine_win.cpp:709*: référence indéfinie vers «*QSysInfo::windowsVersion()*»
    qfilesystemengine_win.o*: Dans la fonction «*tryDriveUNCFallback*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/src/corelib/io/qfilesystemengine_win.cpp:886*: référence indéfinie vers «*QFileSystemEntry::isDriveRoot() const*»
    qfilesystemengine_win.o*: Dans la fonction «*tryFindFallback*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/src/corelib/io/qfilesystemengine_win.cpp:945*: référence indéfinie vers «*QFileSystemEntry::isDriveRoot() const*»
    qfilesystemengine_win.o*: Dans la fonction «*QFileSystemEngine::fillMetaData(QFileSystemEntry const&, QFileSystemMetaData&, QFlags<QFileSystemMetaData::MetaDataFlag>)*»*:
    /home/astro01/Documents/repository/qt5.7/qt-everywhere-opensource-src-5.7.1/qtbase/src/corelib/io/qfilesystemengine_win.cpp:1038*: référence indéfinie vers «*QFileSystemEntry::isDriveRoot() const*»
    qfilesystemengine_win.o*: Dans la fonction «*QFileSystemEngine::currentPath()*»*:

Discussions similaires

  1. Equivalent du move linux pour Windows
    Par hpl76 dans le forum Windows
    Réponses: 2
    Dernier message: 05/08/2011, 21h03
  2. Développer en linux, pour windows ?
    Par FMaz dans le forum Débuter
    Réponses: 8
    Dernier message: 07/11/2009, 09h59
  3. Un compilateur Linux pour Windows ?
    Par Kicker dans le forum Windows
    Réponses: 1
    Dernier message: 12/04/2008, 02h59
  4. cherche équivalent librairie C++ linux pour windows
    Par jejerome dans le forum Bibliothèques
    Réponses: 3
    Dernier message: 01/03/2006, 19h49
  5. Equivalent de la commande Select de linux pour Windows
    Par bibi_64 dans le forum Windows
    Réponses: 2
    Dernier message: 18/10/2005, 09h39

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