Bienvenue, Invité. Merci de vous connecter ou de vous inscrire. Avez-vous oublié d'activer ?

Voir les contributions

Cette section vous permet de consulter les contributions (messages, sujets et fichiers joints) d'un utilisateur. Vous ne pourrez voir que les contributions des zones auxquelles vous avez accès.


Messages - jantzen

Pages: [1]
1
Général / Re: SFML reference error (CMake, Clion, Windows and MinGW)
« le: Avril 27, 2017, 12:44:40 am »
I'm confused.  What does your main.cpp look like?  Is it the same as above?

In a stack overflow comment you stated the program exits with code 0.  If your main.cpp is the same as above this is good.  You need to change your main.cpp to look like my example.  You don't have a loop to display the window, your code only declares a window object, it doesn't use it.

Without an event loop it will just exit with code 0 and maybe flash a console window.

2
Général / Re: SFML reference error (CMake, Clion, Windows and MinGW)
« le: Avril 22, 2017, 04:16:43 pm »
I'm not an expert in any of this, but I got an example working.

Using:
CLion 2016.3.2, with included cmake
mingw64
SFML 2.4 for mingw64, installed to C:/SFML


CMakeLists.txt
https://pastebin.com/PxhBfWmc

I had to add line 16 and change link 22 from TARGET to my project name.

Looking at your project setup, it looks like the SFML dll files are in the root of your project directory.  The dlls should be in the cmake-build-debug directory where the executable (Adventure.exe) is placed after building the project.

main.cpp
#include "config.h"
#include <iostream>
#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "My window");

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }

    return 0;
}
 


Pages: [1]
anything