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 - Zeba

Pages: [1]
1
After a whole day of trying, I finally managed to do it :) Thank you very much eXpl0it3r for guiding me in the right direction !

I want to share my actions, I hope that this tutorial will also help someone.
So here's what I did to make SFML work on Windows 11 and Code::Blocks 20.03:

1) First I downloaded the latest version of the gcc compiler and MinGW for the MSCVRT runtime from WinLibs https://winlibs.com/. Previously, I had a compiler and library installed in the UCRT runtime environment.
2) Then I switched my OS compiler to it, and also switched to it in the Code::Blocks compiler settings.
3) I built SFML version 2.5.1 from source files using CMake 3.25.3.
4) Opened the SFML build in Code::Blocks and generated several configurations for it in CMake (for shared libraries enabled/disabled, both for the runtime mode and for debug mode).

Victory !
* Now you can create an empty project and connect the project compiler to the SFML source "include" folder, and the project linker to the SFML Build "lib" folder.
* You need to link the necessary libraries for debug mode and release mode.
* Copy and paste the necessary dll libraries into the project folder and create a file main.cpp.

Paste the code from the SFML website in it and build your project - and now you will see a green circle

Ha, that was really fun :) Good luck to everyone !

2
I changed the CodeBlocks compiler to my installed compiler in my OS - gcc 13.1.0. Also, I switched SFML to version 2.6.0 x32.
 
When I build my project, I get the same issues again as before, but with a different version of my compiler.
 
 -------------- Build: Debug in NewProject (compiler: GNU GCC Compiler)---------------

g++.exe -L..\..\..\..\..\..\SFML-2.6.0\lib -o bin\Debug\NewProject.exe obj\Debug\main.o   -lsfml-graphics -lsfml-window -lsfml-system
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.6.0\lib/libsfml-graphics.a when searching for -lsfml-graphics
...
and so on.

Now the gcc compiler versions are the same, but still nothing works. Here's what I have - https://imgur.com/a/B3XHj9L



The second option I tried is to create SFML from source code using CMake. So, first I downloaded the SFML 2.5.1 source archive and generated a build with the "Code::Blocks - MinGW Makefiles" option enabled.
The SFML build is generated successfully, but when I run the build process in CodeBlocks, I get the following errors - https://imgur.com/a/YyIdnU3

I have Windows 11 and I use the gcc compiler in the UCRT runtime. Does this somehow affect the work in general?

I'm confused  :-\

3
It seems to me that I am making progress in finding a solution.

I tried to fix this problem in different versions of SFML, and this is what I got -

* 2.6.0 x64 - After I inserted all the following dll libraries into the folder with the .exe file, I received an error message that the system could not find the entry point (_ZSt28__throw_bad_array_new_lengthv) in the DLL ("sfml-graphics-2.dll "). Couldn't figure out what was wrong with it.

* 2.6.0 x32, 2.5.1 both x32 and x64 (MinGW), 2.5.1 (SJLJ) x32 - There is a different situation here, but all these SFML versions behave the same. The compiler seems to have found the missing dlls, but now it sends me this build log:

-------------- Build: Debug in NewProject (compiler: GNU GCC Compiler)---------------

g++.exe -L..\..\..\..\..\..\SFML-2.5.1\lib -o bin\Debug\NewProject.exe obj\Debug\main.o   -lsfml-graphics-d -lsfml-window-d -lsfml-system-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib/libsfml-graphics-d.a when searching for -lsfml-graphics-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib\libsfml-graphics-d.a when searching for -lsfml-graphics-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib/libsfml-graphics-d.a when searching for -lsfml-graphics-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-graphics-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib/libsfml-window-d.a when searching for -lsfml-window-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib\libsfml-window-d.a when searching for -lsfml-window-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib/libsfml-window-d.a when searching for -lsfml-window-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-window-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib/libsfml-system-d.a when searching for -lsfml-system-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib\libsfml-system-d.a when searching for -lsfml-system-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible ..\..\..\..\..\..\SFML-2.5.1\lib/libsfml-system-d.a when searching for -lsfml-system-d
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-system-d
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
4 error(s), 0 warning(s) (0 minute(s), 0 second(s))



The build messages say:

Id.exe | cannot find -lsfml-graphics-d
Id.exe | cannot find -lsfml-window-d
Id.exe | cannot find -lsfml-system-d
          | error: Id returned 1 exit status




I have no idea what to do next

4
When I want to build my project, I get three warnings that the system cannot detect such dlls as sfml-graphics-2.dll , sfml-window-2.dll , sfml-system-2-dll.

I followed the tutorial on the official website and determined the path to the "include" folder for the compiler and "lib" folder for the linker in Project Build Options.

I want to use SFML as a dynamic library, so for Debug, I have linked three libraries: sfml-graphics-d, sfml-windows-d, sfml-system-d and for Release, I linked the same libraries without prefixes.

Further, when building a project, I encounter the problem that the system could not find the dll files that I described above.

I read on the forum that I need to copy these dll files and paste them into the project folder, but I don't understand two things:
1. Where and what files should I insert? (I copied these dll files to my project folder once, but other errors started to occur)
2. Why copy them at all if I have already configured the path to the library in Project Build Settings?

I apologize if I raise strange questions, I'm just starting my way with SFML, and I want to figure out how to configure it correctly

Pages: [1]