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

Auteur Sujet: Build sur ubuntu avec ccmake avec mingw  (Lu 1127 fois)

0 Membres et 1 Invité sur ce sujet

Umbre

  • Newbie
  • *
  • Messages: 16
    • Voir le profil
Build sur ubuntu avec ccmake avec mingw
« le: Janvier 31, 2022, 10:30:39 am »
Bonjour, je suis débutant avec ubuntu.
Je voudrais pouvoir générer des .exe pour windows depuis mon ubuntu.
Pour cela j'ai installé mingw (qui fonctionne bien).
Il faudrait maintenant que je compile la sfml en static avec mingw.
J'ai installé ccmake (un intermédiaire entre cmake en ligne de commande et cmake-gui), mais je ne sais pas comment lui dire que je veux utiliser le compilateur gcc de mingw et pas celui d'ubuntu.

J'espère avoir été clair.
Merci beaucoup à ceux qui pourront m'aider,
Bonne journée.
« Modifié: Janvier 31, 2022, 10:38:14 am par Umbre »

Umbre

  • Newbie
  • *
  • Messages: 16
    • Voir le profil

JaydenSanderson

  • Invité
Re: Build sur ubuntu avec ccmake avec mingw
« Réponse #2 le: Mai 17, 2023, 02:17:27 pm »
Hello, I work in this field, I will try to help you

To compile SFML in static mode with MinGW on Ubuntu, you can follow these steps:

Open a terminal and navigate to the SFML source code directory.

Create a new build directory and navigate into it:

bash
Copy code
mkdir build && cd build
Configure the build using CMake, specifying the MinGW compiler and enabling static linking:

javascript
Copy code
cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=/path/to/mingw/gcc -DCMAKE_CXX_COMPILER=/path/to/mingw/g++ -DSFML_BUILD_STATIC=TRUE ..
Replace /path/to/mingw/gcc and /path/to/mingw/g++ with the actual paths to your MinGW GCC and G++ compilers, respectively.

Build the SFML library:

css
Copy code
cmake --build .
Once the build process completes successfully, you should have the static SFML libraries (.a files) in the lib folder of the build directory.

Make sure you have the necessary dependencies installed and adjust the paths according to your setup. I hope this helps you achieve your goal. Have a great day!

 

anything