Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - n1clsxd

Pages: [1]
1
Hello.
I'm trying to compile a simple .cpp using SFML. (The same as the official tutorial, which only renders a green circle just for testing).
I'm using VSCode to edit, using MinGW in the latest version to compile and SFML in the latest version from the official website (I downloaded it yesterday).
I used CMake to build SFML for MinGW because the version I was using was giving errors even putting the .dll in the executable folder.
First I tried to use the dynamic libraries and the executable gave an error mentioning each linked one.
I tried to link statically and gave an error only.
After several hours of searching, I couldn't find a solution anymore.
In resume, my .cpp compile with no errors but my .exe doesn't work.
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;
}

Terminal commands to compile:
g++ -c main.cpp -DSFML_STATIC -IC:SFML/include

g++ main.o -o workpls -LC:/SFML/lib -lsfml-main -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lwinmm -lopengl32 -lgdi32 -lfreetype

Error:


Means:
"Entry point not found"
"Could not find procedure entry point ... in dynamic link library C: \ PATH \ workpls.exe"

Pages: [1]
anything