News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Problem with SFML 2.0 libraries

Started by Qday, May 27, 2024, 06:18:17 AM

Previous topic - Next topic

stahta01

#15
Zipped project attached.

Edit: I thought I created a SFML project in the recent past; and, I found it.

Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Qday

Quote from: stahta01 on July 02, 2024, 04:09:13 PM
So, install SFML under the MSys2 environment you are using and change the CB project to use the library.

Which MSys2 environment you are using? I will try to create an CB Project.

Tim S.

GNU bash, version 5.2.21(1)-release (x86_64-pc-msys) / msys2-x86_64-20240113

I instaled the SFML from (https://packages.msys2.org/package/mingw-w64-x86_64-sfml?repo=mingw64)
using "pacman -S mingw-w64-x86_64-sfml" .

stahta01

#17
So, download the demo project I zipped up and configure Code::Blocks to use MINGW64 MSys2 GCC and build and run the project.

It worked for me under UCRT64 with package mingw-w64-ucrt-x86_64-sfml installed.

Edit: You do know what an MSYS2 environment is, correct? Example: MINGW64, MINGW32, UCRT64, and etc.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Qday

Quote from: stahta01 on July 02, 2024, 05:21:33 PM
So, download the demo project I zipped up and configure Code::Blocks to use MINGW64 MSys2 GCC and build and run the project.

It worked for me under UCRT64 with package mingw-w64-ucrt-x86_64-sfml installed.

Edit: You do know what an MSYS2 environment is, correct? Example: MINGW64, MINGW32, UCRT64, and etc.

Tim S.

I read some things and now I know what mysys enviroments are but still, I cant use them. Its hard for me to find any usefull documentary or tutorials on how to do it.

I tried just config CB to use mingw-w64-ucrt-x86_64-sfml libraries but i get an error that i cant make sens off. Im sorry if im being anoying but i just wanna play with SFML and write some code. And here I am trying to fix this f..  problem for 2 whole days.


-------------- Clean: Debug_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

Cleaned "demo_sfml - Debug_shared"

-------------- Clean: Release_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

Cleaned "demo_sfml - Release_shared"

-------------- Clean: Debug_static in demo_sfml (compiler: GNU GCC Compiler)---------------

Cleaned "demo_sfml - Debug_static"

-------------- Clean: Release_static in demo_sfml (compiler: GNU GCC Compiler)---------------

Cleaned "demo_sfml - Release_static"

-------------- Build: Debug_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g -IC:\msys64\mingw64\include -c D:\CPP\testsfml2\main.cpp -o obj\Debug\main.o
g++.exe -LC:\msys64\mingw64\lib -o bin\Debug\testsfml.exe obj\Debug\main.o  -static-libgcc -static  -lsfml-window.dll -lsfml-graphics.dll -lsfml-system.dll -mwindows
Output file is bin\Debug\testsfml.exe with size 2.37 MB

-------------- Build: Release_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2 -IC:\msys64\mingw64\include -c D:\CPP\testsfml2\main.cpp -o obj\Release\main.o
g++.exe -LC:\msys64\mingw64\lib -o bin\Release\testsfml.exe obj\Release\main.o  -static-libgcc -static -s  -lsfml-window.dll -lsfml-graphics.dll -lsfml-system.dll -mwindows
Output file is bin\Release\testsfml.exe with size 758.50 KB

-------------- Build: Debug_static in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g -DSFML_STATIC -IC:\msys64\mingw64\include -c D:\CPP\testsfml2\main.cpp -o obj\Debug_static\main.o
g++.exe -LC:\msys64\mingw64\lib -o bin\Debug_static\testsfml.exe obj\Debug_static\main.o  -static-libgcc -static  -lsfml-main -lsfml-window-s -lsfml-graphics-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\mingw64\lib\libsfml-system-s.a(Err.cpp.obj):(.rdata+0x80): undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::seekpos(std::fpos<int>, std::_Ios_Openmode)'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 2 second(s))
2 error(s), 0 warning(s) (0 minute(s), 2 second(s))


stahta01

#19
Why did you add "-static-libgcc -static" these options?

Are you capable of learning? Why did you add all of the options incorrect options!

A list of clearly wrong options! NOTE: "-static-libgcc -static" likely is wrong; but, might be okay.
-LC:\msys64\mingw64\lib

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

My build log of the project.

-------------- Build: Debug_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Debug\main.o
g++.exe  -o bin\Debug\testsfml.exe obj\Debug\main.o   -lsfml-window.dll -lsfml-graphics.dll -lsfml-system.dll
Output file is bin\Debug\testsfml.exe with size 368.23 KB

-------------- Build: Release_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Release\main.o
g++.exe  -o bin\Release\testsfml.exe obj\Release\main.o  -s  -lsfml-window.dll -lsfml-graphics.dll -lsfml-system.dll -mwindows
Output file is bin\Release\testsfml.exe with size 21.00 KB

-------------- Build: Debug_static in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g -DSFML_STATIC  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Debug_static\main.o
g++.exe  -o bin\Debug_static\testsfml.exe obj\Debug_static\main.o   -lsfml-main -lsfml-window-s -lsfml-graphics-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32
Output file is bin\Debug_static\testsfml.exe with size 1.43 MB

-------------- Build: Release_static in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2 -DSFML_STATIC  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Release_static\main.o
g++.exe  -o bin\Release_static\testsfml.exe obj\Release_static\main.o   -lsfml-main -lsfml-window-s -lsfml-graphics-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32 -mwindows
Output file is bin\Release_static\testsfml.exe with size 1.21 MB
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 0 warning(s) (0 minute(s), 5 second(s))
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Qday

Quote from: stahta01 on July 03, 2024, 04:10:25 AM
My build log of the project.

-------------- Build: Debug_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Debug\main.o
g++.exe  -o bin\Debug\testsfml.exe obj\Debug\main.o   -lsfml-window.dll -lsfml-graphics.dll -lsfml-system.dll
Output file is bin\Debug\testsfml.exe with size 368.23 KB

-------------- Build: Release_shared in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Release\main.o
g++.exe  -o bin\Release\testsfml.exe obj\Release\main.o  -s  -lsfml-window.dll -lsfml-graphics.dll -lsfml-system.dll -mwindows
Output file is bin\Release\testsfml.exe with size 21.00 KB

-------------- Build: Debug_static in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g -DSFML_STATIC  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Debug_static\main.o
g++.exe  -o bin\Debug_static\testsfml.exe obj\Debug_static\main.o   -lsfml-main -lsfml-window-s -lsfml-graphics-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32
Output file is bin\Debug_static\testsfml.exe with size 1.43 MB

-------------- Build: Release_static in demo_sfml (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -O2 -DSFML_STATIC  -c H:\devel\cb_projects\test\testsfml\main.cpp -o obj\Release_static\main.o
g++.exe  -o bin\Release_static\testsfml.exe obj\Release_static\main.o   -lsfml-main -lsfml-window-s -lsfml-graphics-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32 -mwindows
Output file is bin\Release_static\testsfml.exe with size 1.21 MB
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 0 warning(s) (0 minute(s), 5 second(s))


Are you unable of teaching ?? U honestly did not help me at all with my problem. Just pointing out how dumb I am. I just wanted to learn how to code and u are the worst person i couldve talked too.

I just istaled VS c++ followed one simple guide and made it all work. Very much not thank you.

stahta01

Unable to answer questions! I still have no idea what MSys2 environment you are using; but, maybe you have no idea.

So, A help vampire or extreme newbie! Goodbye.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

everSome

#23
If you are still using the ucrt environment of MSYS2, you can get their binary package of SFML via

pacman -S mingw-w64-ucrt-x86_64-sfml

Doing so currently will get you SFML 2.6.1

stahta01

Quote from: everSome on September 07, 2024, 01:10:17 PM
If you are still using the ucrt environment of MSYS2, you can get their binary package of SFML via

pacman -S mingw-w64-ucrt-x86_64-sfml

Doing so currently will get you SFML 2.6.1

That package name is for the UCRT64 environment.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

everSome

Quote from: stahta01 on September 07, 2024, 02:11:25 PM
Quote from: everSome on September 07, 2024, 01:10:17 PM
If you are still using the ucrt environment of MSYS2, you can get their binary package of SFML via

pacman -S mingw-w64-ucrt-x86_64-sfml

Doing so currently will get you SFML 2.6.1

That package name is for the UCRT64 environment.

Tim S.

Right you are! At one point in this thread, the originator showed a listing that indicated he was binding against the UCRT64 variant. However, he seems quite confused. That's why I prefaced my comment with "If you are still using ..."