Bienvenue, Invité. Merci de vous connecter ou de vous inscrire.
Avez-vous perdu votre e-mail d'activation ?

Auteur Sujet: CrossCompilation Windows sous Linux  (Lu 2126 fois)

0 Membres et 1 Invité sur ce sujet

wamilou

  • Newbie
  • *
  • Messages: 3
    • Voir le profil
CrossCompilation Windows sous Linux
« le: Mai 10, 2014, 11:06:41 pm »
Bonjour à tous,

J'ai tenté de compiler sfml pour Windows à partir d'une machine Linux ( automatisation grâce à Jenkins ). Je suis arrivé à résoudre 2-3 problèmes mais là je bloque.

En fait, je ne comprends pas pourquoi cmake tente de trouver X11 pour compiler pour Windows ...

Script shell pour compiler :
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=i586-mingw32msvc-gcc -DCMAKE_CXX_COMPILER=i586-mingw32msvc-g++ -DCMAKE_RC_COMPILER=i586-mingw32msvc-windres -DOPENAL_LIBRARY=libopenal32.a ..
make

Et voici la sortie de la console :
cmake -G Unix Makefiles -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=i586-mingw32msvc-gcc -DCMAKE_CXX_COMPILER=i586-mingw32msvc-g++ -DCMAKE_RC_COMPILER=i586-mingw32msvc-windres -DOPENAL_LIBRARY=libopenal32.a ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/i586-mingw32msvc-gcc
-- Check for working C compiler: /usr/bin/i586-mingw32msvc-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i586-mingw32msvc-g++
-- Check for working CXX compiler: /usr/bin/i586-mingw32msvc-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Found OpenGL: opengl32
-- Found GLEW: /var/lib/jenkins/workspace/SFML/extlibs/libs-mingw/x86/libglew.a
-- Found JPEG: /var/lib/jenkins/workspace/SFML/extlibs/libs-mingw/x86/libjpeg.a
-- Found Freetype: /var/lib/jenkins/workspace/SFML/extlibs/libs-mingw/x86/libfreetype.a
-- Found OpenAL: /var/lib/jenkins/workspace/SFML/windowsbuild/libopenal32.a
-- Found SNDFILE: /var/lib/jenkins/workspace/SFML/extlibs/libs-mingw/x86/libsndfile.a
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_RC_COMPILER= i586-mingw32msvc-windres

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/i586-mingw32msvc-gcc
-- Check for working C compiler: /usr/bin/i586-mingw32msvc-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i586-mingw32msvc-g++
-- Check for working CXX compiler: /usr/bin/i586-mingw32msvc-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /usr/share/cmake-2.8/Modules/FindX11.cmake:411 (MESSAGE):
  Could not find X11
Call Stack (most recent call first):
  src/SFML/Window/CMakeLists.txt:184 (find_package)


-- Configuring incomplete, errors occurred!

Si quelqu'un aurait une idée pour fixer ce problème, je prends !
Merci d'avance pour les futures réponses à mon problème.

PS : Si vous voulez aller voir par vous même : http://jenkins.pulpgroup.org/job/SFML/

wamilou

  • Newbie
  • *
  • Messages: 3
    • Voir le profil
Re : CrossCompilation Windows sous Linux
« Réponse #1 le: Juin 25, 2014, 11:41:56 am »
Bon, je vais remonter mon vieux sujet mais je suis arrivé à résoudre les problèmes durant la configuration cmake.

Maintenant c'est lors de la compilation que le compilateur ne trouve pas GL/glew.h
Citer
[ 56%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Font.cpp.obj
In file included from /var/lib/jenkins/workspace/SFML/src/SFML/Graphics/GLCheck.hpp:32,
                 from /var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:29:
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/GLExtensions.hpp:77:25: error: GL/glew.h: Aucun fichier ou dossier de ce type
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:35:22: error: ft2build.h: Aucun fichier ou dossier de ce type
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:36:10: error: #include expects "FILENAME" or <FILENAME>
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:37:10: error: #include expects "FILENAME" or <FILENAME>
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:38:10: error: #include expects "FILENAME" or <FILENAME>
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:39:10: error: #include expects "FILENAME" or <FILENAME>
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:47: error: ‘FT_Stream’ was not declared in this scope
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:47: error: expected primary-expression before ‘unsigned’
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:47: error: expected primary-expression before ‘unsigned’
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:47: error: expected primary-expression before ‘unsigned’
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:47: error: initializer expression list treated as compound expression
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:48: error: expected ‘,’ or ‘;’ before ‘{’ token
/var/lib/jenkins/workspace/SFML/src/SFML/Graphics/Font.cpp:718: error: expected `}' at end of input
make[2]: *** [src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Font.cpp.obj] Erreur 1
make[1]: *** [src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/all] Erreur 2
make: *** [all] Erreur 2

Voici ce que j'ai tapé pour cmake
Citer
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/etc/toolchains/windows.cmake -DGLEW_LIBRARY=./extlibs/libs-mingw/x86/lib/libglew.a -DGLEW_INCLUDE_PATH=./extlibs/headers -DJPEG_LIBRARY=./extlibs/libs-mingw/x86/libjpeg.a -DJPEG_INCLUDE_DIR=./extlibs/headers/jpeg -DOPENAL_LIBRARY=./extlibs/libs-mingw/x86/libopenal32.a -DOPENAL_INCLUDE_DIR=./extlibs/headers/AL -DFREETYPE_LIBRARY=./extlibs/libs-mingw/x86/libfreetype.a -DFREETYPE_INCLUDE_DIRS=./extlibs/headers/libfreetype/windows -DSNDFILE_LIBRARY=./extlibs/libs-mingw/x86/libsndfile.a -DSNDFILE_INCLUDE_DIR=./extlibs/headers/libsndfile/windows

Et voici mon fichier qui défini la toolchain de Windows sous linux
Citer
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Si quelqu'un a une idée pourquoi le compilateur ne trouve pas GL/glew.h, alors que j'ai bien défini lors de la configuration où se situer les librairies Windows.

 

anything