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

Author Topic: Linking SFML 2.6.1(I will upgrade but not now) to Makefile  (Read 69 times)

0 Members and 1 Guest are viewing this topic.

floppa_dev

  • Newbie
  • *
  • Posts: 15
    • View Profile
Linking SFML 2.6.1(I will upgrade but not now) to Makefile
« on: January 09, 2025, 03:10:59 pm »
Hello! I have this Makefile(VScode + mingw(msys2 on default settings))
I have 1 tab as space
all:run
CC=g++
CFLAGS=-O1 -Wall -std=c++17 -Wno-missing-braces -I./include/ -L ./lib/ -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
TARGET=main.exe
SRC=src/main.cpp
$(TARGET): $(SRC) Makefile
        $(CC) $< -o $@ $(CFLAGS)
build: $(TARGET)
run: build
        ./$(TARGET)

 
but I get this error make: *** [Makefile:10: run] Error -1073741511
D:.
my file tree
-   .gitignore
-   main.exe
-   Makefile
-   README.md
-   sfml-audio-2.dll
-   sfml-audio-d-2.dll
-   sfml-graphics-2.dll
-   sfml-graphics-d-2.dll
-   sfml-network-2.dll
-   sfml-network-d-2.dll
-   sfml-system-2.dll
-   sfml-system-d-2.dll
-   sfml-window-2.dll
-   sfml-window-d-2.dll
-   tree.txt
-  
+¦¦¦.github
-   L¦¦¦workflows
-           jekyll-gh-pages.yml
-           static.yml
-          
+¦¦¦include
-   -   desktop.ini
-   -  
-   L¦¦¦SFML
-       -   Audio.hpp
-       -   Config.hpp
-       -   desktop.ini
-       -   GpuPreference.hpp
-       -   Graphics.hpp
-       -   Main.hpp
-       -   Network.hpp
-       -   OpenGL.hpp
-       -   System.hpp
-       -   Window.hpp
-       -  
-       +¦¦¦Audio
-       -       AlResource.hpp
-       -       desktop.ini
-       -       Export.hpp
-       -       InputSoundFile.hpp
-       -       Listener.hpp
-       -       Music.hpp
-       -       OutputSoundFile.hpp
-       -       Sound.hpp
-       -       SoundBuffer.hpp
-       -       SoundBufferRecorder.hpp
-       -       SoundFileFactory.hpp
-       -       SoundFileFactory.inl
-       -       SoundFileReader.hpp
-       -       SoundFileWriter.hpp
-       -       SoundRecorder.hpp
-       -       SoundSource.hpp
-       -       SoundStream.hpp
-       -      
-       +¦¦¦Graphics
-       -       BlendMode.hpp
-       -       CircleShape.hpp
-       -       Color.hpp
-       -       ConvexShape.hpp
-       -       desktop.ini
-       -       Drawable.hpp
-       -       Export.hpp
-       -       Font.hpp
-       -       Glsl.hpp
-       -       Glsl.inl
-       -       Glyph.hpp
-       -       Image.hpp
-       -       PrimitiveType.hpp
-       -       Rect.hpp
-       -       Rect.inl
-       -       RectangleShape.hpp
-       -       RenderStates.hpp
-       -       RenderTarget.hpp
-       -       RenderTexture.hpp
-       -       RenderWindow.hpp
-       -       Shader.hpp
-       -       Shape.hpp
-       -       Sprite.hpp
-       -       Text.hpp
-       -       Texture.hpp
-       -       Transform.hpp
-       -       Transformable.hpp
-       -       Vertex.hpp
-       -       VertexArray.hpp
-       -       VertexBuffer.hpp
-       -       View.hpp
-       -      
-       +¦¦¦Network
-       -       desktop.ini
-       -       Export.hpp
-       -       Ftp.hpp
-       -       Http.hpp
-       -       IpAddress.hpp
-       -       Packet.hpp
-       -       Socket.hpp
-       -       SocketHandle.hpp
-       -       SocketSelector.hpp
-       -       TcpListener.hpp
-       -       TcpSocket.hpp
-       -       UdpSocket.hpp
-       -      
-       +¦¦¦System
-       -       Clock.hpp
-       -       desktop.ini
-       -       Err.hpp
-       -       Export.hpp
-       -       FileInputStream.hpp
-       -       InputStream.hpp
-       -       Lock.hpp
-       -       MemoryInputStream.hpp
-       -       Mutex.hpp
-       -       NativeActivity.hpp
-       -       NonCopyable.hpp
-       -       Sleep.hpp
-       -       String.hpp
-       -       String.inl
-       -       Thread.hpp
-       -       Thread.inl
-       -       ThreadLocal.hpp
-       -       ThreadLocalPtr.hpp
-       -       ThreadLocalPtr.inl
-       -       Time.hpp
-       -       Utf.hpp
-       -       Utf.inl
-       -       Vector2.hpp
-       -       Vector2.inl
-       -       Vector3.hpp
-       -       Vector3.inl
-       -      
-       L¦¦¦Window
-               Clipboard.hpp
-               Context.hpp
-               ContextSettings.hpp
-               Cursor.hpp
-               desktop.ini
-               Event.hpp
-               Export.hpp
-               GlResource.hpp
-               Joystick.hpp
-               Keyboard.hpp
-               Mouse.hpp
-               Sensor.hpp
-               Touch.hpp
-               VideoMode.hpp
-               Window.hpp
-               WindowHandle.hpp
-               WindowStyle.hpp
-              
+¦¦¦lib
-   -   libFLAC.a
-   -   libfreetype.a
-   -   libogg.a
-   -   libopenal32.a
-   -   libsfml-audio-d.a
-   -   libsfml-audio-s-d.a
-   -   libsfml-audio-s.a
-   -   libsfml-audio.a
-   -   libsfml-graphics-d.a
-   -   libsfml-graphics-s-d.a
-   -   libsfml-graphics-s.a
-   -   libsfml-graphics.a
-   -   libsfml-main-d.a
-   -   libsfml-main.a
-   -   libsfml-network-d.a
-   -   libsfml-network-s-d.a
-   -   libsfml-network-s.a
-   -   libsfml-network.a
-   -   libsfml-system-d.a
-   -   libsfml-system-s-d.a
-   -   libsfml-system-s.a
-   -   libsfml-system.a
-   -   libsfml-window-d.a
-   -   libsfml-window-s-d.a
-   -   libsfml-window-s.a
-   -   libsfml-window.a
-   -   libvorbis.a
-   -   libvorbisenc.a
-   -   libvorbisfile.a
-   -  
-   L¦¦¦cmake
-       L¦¦¦SFML
-               SFMLConfig.cmake
-               SFMLConfigDependencies.cmake
-               SFMLConfigVersion.cmake
-               SFMLSharedTargets-debug.cmake
-               SFMLSharedTargets-release.cmake
-               SFMLSharedTargets.cmake
-               SFMLStaticTargets-debug.cmake
-               SFMLStaticTargets-release.cmake
-               SFMLStaticTargets.cmake
-              
L¦¦¦src
        main.cpp
main.cpp
#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;
}
 
« Last Edit: January 09, 2025, 04:21:21 pm by floppa_dev »

floppa_dev

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Linking SFML 2.6.1(I will upgrade but not now) to Makefile
« Reply #1 on: January 09, 2025, 03:56:50 pm »
when i try to run the exe i get this error
The procedure entry point _ZNSt15basic_streambuflcSt11char_traitslcEE7seekposESt4posliESt13_Ios_Openmode could not be located in the dynamic link library (path to system32)\sfml-system-2.dll

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11075
    • View Profile
    • development blog
    • Email
Re: Linking SFML 2.6.1(I will upgrade but not now) to Makefile
« Reply #2 on: January 09, 2025, 04:08:33 pm »
-1073741511 = C0000139 which means "Entry point not found"

Sounds like you're mixing runtimes here.
Note that you have to use matching compilers.

It's not enough that they are both "mingw" and not even enough that they use the same-ish GCC version.
They have to match 100%.
If you use different runtimes, you end up with such mismatches in symbol loading.

If you've downloaded SFML from the website, also download and use the MinGW compiler linked on the download page: https://www.sfml-dev.org/download/sfml/2.6.1/

If you want to stick to the compiler you're currently using, you'll have to build SFML yourself.
Or if you're really using msys2, you might be able to download it from the built-in package manager.

Alternatively, you could use something similar to the SFML CMake template (has already been updated to SFML 3): https://github.com/SFML/cmake-sfml-project
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

floppa_dev

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Linking SFML 2.6.1(I will upgrade but not now) to Makefile
« Reply #3 on: January 09, 2025, 04:18:13 pm »
ok thanks I will reply later if this helped

floppa_dev

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Linking SFML 2.6.1(I will upgrade but not now) to Makefile
« Reply #4 on: January 09, 2025, 04:21:01 pm »
yes it worked thank you