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

Author Topic: Could not find procedure entry point ... in dynamic link library main.exe  (Read 1909 times)

0 Members and 1 Guest are viewing this topic.

n1clsxd

  • Newbie
  • *
  • Posts: 0
    • View Profile
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"

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything