Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
654 connectés 

  FORUM HardWare.fr
  Programmation
  Divers

  Crosscompilation sous linux pour w32 avec mingw

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Crosscompilation sous linux pour w32 avec mingw

n°1851954
XaTriX
Posté le 16-02-2009 à 22:58:36  profilanswer
 

Bonjour, je cherche à compiler pour Windows sous Linux :o

 

Sur ma débian etch, j'ai installé binutils, mingw32 etc..

 

J'ai d'abord essayer en spécifiant dans le configure :

# ./configure CXX=i586-mingw32msvc-g++ CC=i586-mingw32msvc-gcc

 

Et au make ça foire :

root@ks39571:/home/openttd/src/0.6.3# make
make[1]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/lang »
[LANG] Compiling and Linking endian_check
[LANG] Testing endianness for host
/bin/sh: ./endian_check: cannot execute binary file
make[1]: *** [endian_host.h] Erreur 126
make[1]: quittant le répertoire « /home/openttd/src/0.6.3/objs/lang »
make[1]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/release »
make -C /home/openttd/src/0.6.3/objs/lang strgen
make[2]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/lang »
[LANG] Compiling core/alloc_func.cpp
[LANG] Compiling string.cpp
[LANG] Compiling strgen/strgen.cpp
[LANG] Compiling and Linking strgen
make[2]: quittant le répertoire « /home/openttd/src/0.6.3/objs/lang »
make -C /home/openttd/src/0.6.3/objs/lang table/strings.h
make[2]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/lang »
[LANG] Generating table/strings.h
./strgen: ./strgen: cannot execute binary file
make[2]: *** [table/strings.h] Erreur 126
make[2]: quittant le répertoire « /home/openttd/src/0.6.3/objs/lang »
make[1]: *** Pas de règle pour fabriquer la cible « ai/ai.d », nécessaire pour « ai/ai.o ». Arrêt.
make[1]: quittant le répertoire « /home/openttd/src/0.6.3/objs/release »
make: *** [all] Erreur 2


:/

 

J'en ai déduit que je m'y suis mal pris :o
J'ai lu le configure et vu qui y'avait une option OS, j'ai mit os=mingw
La au configure :

checking awk... awk
forcing OS... MINGW
checking build system type... x86_64-linux-gnu
checking host system type... x86_64-linux-gnu
checking universal build... no
checking build cc... gcc
checking host cc... gcc
checking build c++... g++
checking host c++... g++
checking host windres... windres not found
I couldn't detect any windres binary on your system
please define the CC/CXX environment to where it is located

 

J'ai mit à jour binutils (qui est censé contenir windres) puis compilé et installe le binutils-2.19.1
Pareil.

 

:??:

 

XaT


Message édité par XaTriX le 16-02-2009 à 23:00:49

---------------
"Xat le punk à chien facho raciste. C'est complexe comme personnage." caudacien 05/10/2020
mood
Publicité
Posté le 16-02-2009 à 22:58:36  profilanswer
 

n°1851956
XaTriX
Posté le 16-02-2009 à 23:01:07  profilanswer
 

# ./configure CC=i586-mingw32msvc-gcc CXX=i58
checking awk... awk
forcing OS... MINGW
checking build system type... i586-mingw32msvc
checking host system type... i586-mingw32msvc
checking universal build... no
checking build cc... i586-mingw32msvc-gcc
checking host cc... i586-mingw32msvc-gcc
checking build c++... i586-mingw32msvc-g++
checking host c++... i586-mingw32msvc-g++
checking host windres... windres not found
I couldn't detect any windres binary on your system
please define the CC/CXX environment to where it is located


---------------
"Xat le punk à chien facho raciste. C'est complexe comme personnage." caudacien 05/10/2020
n°1851974
XaTriX
Posté le 16-02-2009 à 23:25:48  profilanswer
 

J'ai trouvé comment renseigner windres au configure avec "--windres=i586-mingw32msvc-windres"

 

Mais je reviens au même blocage..

# ./configure CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ --windres=i586-mingw32msvc-windres --os=mingw
checking awk... awk
forcing OS... MINGW
checking build system type... i586-mingw32msvc
checking host system type... i586-mingw32msvc
checking universal build... no
checking build cc... i586-mingw32msvc-gcc
checking host cc... i586-mingw32msvc-gcc
checking build c++... i586-mingw32msvc-g++
checking host c++... i586-mingw32msvc-g++
checking host windres... i586-mingw32msvc-windres
.......
root@ks39571:/home/openttd/src/0.6.3# make
make[1]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/lang »
[LANG] Compiling and Linking endian_check.exe
[LANG] Testing endianness for host
/bin/sh: ./endian_check.exe: cannot execute binary file
make[1]: *** [endian_host.h] Erreur 126
make[1]: quittant le répertoire « /home/openttd/src/0.6.3/objs/lang »
make[1]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/release »
make -C /home/openttd/src/0.6.3/objs/lang strgen.exe
make[2]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/lang »
[LANG] Compiling core/alloc_func.cpp
[LANG] Compiling string.cpp
[LANG] Compiling strgen/strgen.cpp
[LANG] Compiling and Linking strgen.exe
make[2]: quittant le répertoire « /home/openttd/src/0.6.3/objs/lang »
make -C /home/openttd/src/0.6.3/objs/lang table/strings.h
make[2]: entrant dans le répertoire « /home/openttd/src/0.6.3/objs/lang »
[LANG] Generating table/strings.h
./strgen.exe: ./strgen.exe: cannot execute binary file
make[2]: *** [table/strings.h] Erreur 126
make[2]: quittant le répertoire « /home/openttd/src/0.6.3/objs/lang »
make[1]: *** Pas de règle pour fabriquer la cible « ai/ai.d », nécessaire pour « ai/ai.o ». Arrêt.
make[1]: quittant le répertoire « /home/openttd/src/0.6.3/objs/release »
make: *** [all] Erreur 2


edit:

 

Ah maintenant j'ai des ".exe" à endien_check.exe et strgen.exe [:dawa]
Peut être en laissant gcc et g++ ?

 

edit2: ah ça avance..

./configure --windres=i586-mingw32msvc-windres --os=mingw
checking awk... awk
forcing OS... MINGW
checking build system type... x86_64-linux-gnu
checking host system type... x86_64-linux-gnu
checking universal build... no
checking build cc... gcc
checking host cc... gcc
checking build c++... g++
checking host c++... g++
checking host windres... i586-mingw32msvc-windres

 

Par contre a la compilation ça avance un peu mieux mais ça me donne ça :

[SRC] DEP ai/trolly/build.cpp
cc1plus: error: unrecognized command line option "-mno-cygwin"
[SRC] DEP airport_gui.cpp
cc1plus: error: unrecognized command line option "-mno-cygwin"
[SRC] DEP airport.cpp
cc1plus: error: unrecognized command line option "-mno-cygwin"
[SRC] DEP aircraft_gui.cpp
cc1plus: error: unrecognized command line option "-mno-cygwin"
[SRC] DEP aircraft_cmd.cpp
cc1plus: error: unrecognized command line option "-mno-cygwin"
[SRC] DEP ai/default/default.cpp
cc1plus: error: unrecognized command line option "-mno-cygwin"
[SRC] DEP ai/ai.cpp
cc1plus: error: unrecognized command line option "-mno-cygwin"


(au moins endian_check et strgen ont marché)

 

XaT


Message édité par XaTriX le 16-02-2009 à 23:30:29

---------------
"Xat le punk à chien facho raciste. C'est complexe comme personnage." caudacien 05/10/2020
n°1852006
olivthill
Posté le 17-02-2009 à 09:17:36  profilanswer
 

Si ça peut aider, voici un makefile qui marche (généré par Dev-C++) pour compiler le fichier toto.cpp avec mingw32 sous Windows pour Windows :

Code :
  1. # Project: toto
  2. # Makefile created by Dev-C++ 4.9.9.2
  3. CPP  = g++.exe
  4. WINDRES = windres.exe
  5. RES  =
  6. OBJ  = toto.o $(RES)
  7. LINKOBJ  = toto.o $(RES)
  8. LIBS =  -L"D:/Dev-Cpp/lib" 
  9. INCS =  -I"D:/Dev-Cpp/include"
  10. CXXINCS =  -I"D:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"D:/Dev-Cpp/include/c++/3.4.2/backward"  -I"D:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"D:/Dev-Cpp/include/c++/3.4.2"  -I"D:/Dev-Cpp/include"
  11. BIN  = toto.exe
  12. CXXFLAGS = $(CXXINCS) 
  13. CFLAGS = $(INCS) 
  14. RM = rm -f
  15. .PHONY: all all-before all-after clean clean-custom
  16. all: all-before toto.exe all-after
  17. clean: clean-custom
  18. ${RM} $(OBJ) $(BIN)
  19. $(BIN): $(OBJ)
  20. $(CPP) $(LINKOBJ) -o "toto.exe" $(LIBS)
  21. toto.o: toto.cpp
  22. $(CPP) -c toto.cpp -o toto.o $(CXXFLAGS)


Message édité par olivthill le 17-02-2009 à 09:20:47

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Divers

  Crosscompilation sous linux pour w32 avec mingw

 

Sujets relatifs
[solved]Linux Ssh FTP > Transférer des dossiers entiers[C][Linux]Que fait un programme qui reçoit un signal ?
Eclipse, mingw et erreur not binary found[RESOLU] compil avec lib pthread sous linux
[Résolu] Empêcher Ctrl-C et Ctrl-Alt-Fx en Shell LinuxConnexion à une base Sql Serveur sous linux
comment savoir si un fichier sous linux a été modifier ?faire des macros avec l'operateur << windows et linux
[Bash Linux] compter dans un fichier[Bash Linux] nombre d'un caractère choisi
Plus de sujets relatifs à : Crosscompilation sous linux pour w32 avec mingw


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR