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

Auteur Sujet: Problème configuration SFML sur Visual Studio Code  (Lu 973 fois)

0 Membres et 1 Invité sur ce sujet

MrRex

  • Newbie
  • *
  • Messages: 1
    • Voir le profil
Problème configuration SFML sur Visual Studio Code
« le: Août 11, 2022, 12:04:45 pm »
Bonjour,
je teste SFML pour la première fois.
J'essaye de l'utiliser sur Visual Studio Code.
J'ai installé SFML GCC 7.3.0 MinGW (SEH) - 64-bit (j'ai un 64 bits).
J'ai essayé ce code :
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}


J'ai compilé :
g++ -c main.cpp -I<installation-de-sfml>/include (j'ai bien mis mon répertoire à la place)

Ensuite j'ai fait :
g++ main.o -o sfml-app -L<installation-de-sfml>/lib -lsfml-graphics -lsfml-window -lsfml-system

Puis : export LD_LIBRARY_PATH=<installation-de-sfml>/lib

Et enfin : ./sfml-app
Le problème : quand j’exécute cette commande, rien ne se passe. Aucune erreur. Rien. J'ai rentré la commande plusieurs fois, rien ne se passe.

Voyez-vous d'où vient le problème  ?

Merci.

JaydenSanderson

  • Invité
Re: Problème configuration SFML sur Visual Studio Code
« Réponse #1 le: Mai 17, 2023, 02:18:47 pm »
It's great to hear that you're trying out SFML for the first time. Based on the code and commands you provided, it seems like you've followed the correct steps for compiling and running the SFML application.

However, if nothing happens when you execute the "./sfml-app" command, there might be a few potential issues to consider:

Double-check that you have correctly set the "<installation-de-sfml>" placeholder in the compilation and library paths to the actual path where SFML is installed on your system.

Make sure you have all the necessary SFML dependencies installed on your machine. SFML requires certain libraries to function properly, so ensure that they are correctly installed.

Verify that you have the appropriate versions of the SFML libraries for your system architecture (in your case, 64-bit). Mismatched library versions can cause issues.

Check for any error messages or warnings during the compilation process. Even if the application compiles successfully, there may be runtime errors that prevent it from running correctly.

I hope these suggestions help you troubleshoot the issue. If the problem persists, please provide any error messages or additional details for further assistance. Good luck with your SFML project!

intensityboss

  • Newbie
  • *
  • Messages: 5
    • Voir le profil
Re: Problème configuration SFML sur Visual Studio Code
« Réponse #2 le: Novembre 07, 2023, 08:47:11 am »
It's nice to hear you're giving SFML a shot for the first time. Based on the code and commands you gave, it appears like you followed the right compilation and running procedures for the SFML program.
 rainbow obby

caperssesame

  • Newbie
  • *
  • Messages: 1
    • Voir le profil
Re: Problème configuration SFML sur Visual Studio Code
« Réponse #3 le: Janvier 09, 2024, 08:13:00 am »
It's wonderful to learn that this is your first time experimenting with SFML. It appears that you followed the right instructions for generating and executing the SFML application based on the code and commands you supplied. Verify that your computer is installed with all required SFML dependencies. To ensure proper operation, make sure the libraries needed by SFML are installed correctly.

maicleusa

  • Newbie
  • *
  • Messages: 9
    • Voir le profil
Re: Problème configuration SFML sur Visual Studio Code
« Réponse #4 le: Avril 09, 2024, 05:27:36 am »
Overall, the article is a testament to the power of well-crafted writing, leaving a lasting impression on its audience and setting a high standard for journalistic excellence. Among Us Online