DEV Community

Beni
Beni

Posted on

Pls Help

Image description

Please help me. I have correctly configured, according to ChatGPT, GeminiAi, and the tutorials on Youtube, the SFML library and I am unable to run a program that only creates a window. The SQL version is 3.0.0, and the VS version is 17.14.0. I don't know what else to do. I have tried many methods, but I am unable to get rid of those errors. If it helps, I leave below what appears in the output:

Build started at 09:54 PM...
1>------ Build started: Project: configurare, Configuration: Debug x64 ------
1>configurare.cpp
1>C:\Users_\OneDrive\Desktop\SFML-3.0.0\include\SFML\System\Exception.hpp(41,47): warning C4275: non dll-interface class 'std::runtime_error' used as base for dll-interface class 'sf::Exception'
1>(compiling source file 'configurare.cpp')
1> C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.44.34918\include\stdexcept(100,30):
1> see declaration of 'std::runtime_error'
1> C:\Users_\OneDrive\Desktop\SFML-3.0.0\include\SFML\System\Exception.hpp(41,23):
1> see declaration of 'sf::Exception'
1>C:\Users_\OneDrive\Desktop\Proiecte_Visual_Studio\Proiecte\configurare\configurare.cpp(8,19): error C2512: 'sf::Event': no appropriate default constructor available
1> C:\Users_\OneDrive\Desktop\SFML-3.0.0\include\SFML\Window\Event.hpp(46,7):
1> see declaration of 'sf::Event'
1>C:\Users_\OneDrive\Desktop\Proiecte_Visual_Studio\Proiecte\configurare\configurare.cpp(9,23): error C2660: 'sf::WindowBase::pollEvent': function does not take 1 arguments
1> C:\Users_\OneDrive\Desktop\SFML-3.0.0\include\SFML\Window\WindowBase.hpp(226,40):
1> see declaration of 'sf::WindowBase::pollEvent'
1> C:\Users_\OneDrive\Desktop\Proiecte_Visual_Studio\Proiecte\configurare\configurare.cpp(9,23):
1> while trying to match the argument list '(sf::Event)'
1>C:\Users_\OneDrive\Desktop\Proiecte_Visual_Studio\Proiecte\configurare\configurare.cpp(10,23): error C2039: 'type': is not a member of 'sf::Event'
1> C:\Users_\OneDrive\Desktop\SFML-3.0.0\include\SFML\Window\Event.hpp(46,7):
1> see declaration of 'sf::Event'
1>Done building project "configurare.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 09:54 PM and took 05.877 seconds ==========

The code is below:

#include <SFML/Graphics.hpp>

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

    while (window.isOpen()) {
        sf::Event event; // Aici e corect!
        while (window.pollEvent(event)) {
            if (event.type == sf::Event::Closed) {
                window.close();
            }
        }

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

    return 0;
}
Enter fullscreen mode Exit fullscreen mode

`

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly β€” using the tools and languages you already love!

Learn More

Top comments (0)

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

πŸ‘‹ Kindness is contagious

If you found this article helpful, please give a ❀️ or share a friendly comment!

Got it