SFML community forums

Help => General => Topic started by: n1clsxd on May 02, 2020, 04:54:36 pm

Title: Could not find procedure entry point ... in dynamic link library main.exe
Post by: n1clsxd on May 02, 2020, 04:54:36 pm
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:
(https://i.imgur.com/iQPqG2h.png)

Means:
"Entry point not found"
"Could not find procedure entry point ... in dynamic link library C: \ PATH \ workpls.exe"
Title: Re: Could not find procedure entry point ... in dynamic link library main.exe
Post by: eXpl0it3r on May 12, 2020, 02:41:25 pm
Pre C++11 and C++11 std::string have different ABI and if you build your application with C++11, but the SFML libs have not been build with C++11 you can get this error.
Easiest solution is to just build SFML with the same flags as you build your own application.