User forums > Help

SFML Not working

(1/3) > >>

BL4238954:
Hi all,

I've been working on SFML for the past two years trying to get it working but nothing happened. Even after watching countless Youtube videos and checking posts in the forums, nothing worked.

Pls I need help

Miguel Gimenez:
"Not working" is far too vague, please attach symptoms, build log and screen captures...

omlk:
You read this SFML Learn?

BL4238954:

--- Quote from: Miguel Gimenez on December 11, 2023, 09:08:25 pm ---"Not working" is far too vague, please attach symptoms, build log and screen captures...

--- End quote ---

Well, ever since I started with SFML x64bit on CodeBlocks, error like:
  undefined reference to `__imp__ZN2sf6StringClEPKcRKSt6locale'...
with build logs:
       g++.exe -LC:\Users\%username%\SFML-2.5.1\lib -o bin\Debug\sfml.exe obj\Debug\main.o   -lsfml-graphics-d -lsfml-audio-d -lsfml-network-d -lsfml-window-d -lsfml-system-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
obj\Debug\main.o: in function `main':
C:/Users/%username%/sfml/main.cpp:5: undefined reference to `__imp__ZN2sf6StringC1EPKcRKSt6locale'



And after folling some videos on Youtube, I later SFML-2.5.1 x32bit then this happened:
  cannot find -lsfml-graphics-d: No such file or directory...
with build logs:
  g++.exe -L"C:\Users\%username%\Documents\New folder\SFML-2.5.1-windows-gcc-7.3.0-mingw-32-bit\SFML-2.5.1\lib" -o bin\Debug\sfml.exe obj\Debug\main.o   -lsfml-graphics-d -lsfml-audio-d -lsfml-network-d -lsfml-window-d -lsfml-system-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Users\%username%\Documents\New folder\SFML-2.5.1-windows-gcc-7.3.0-mingw-32-bit\SFML-2.5.1\lib/libsfml-graphics-d.a when searching for -lsfml-graphics-d

At least got another error

Then after going through the forum, it said that I should change add 'lib' to the beginning of the library files and still got the same error

Miguel Gimenez:
The first case looks like you are mixing Visual Studio libraries with gcc objects.
In the second you are mixing 64 bit with 32 bit.

I would not use precompiled libraries, just compile SFML with the same gcc used for the main program. All C++ code that will be linked together must be compiled with the same compiler.

There is a complete tutorial for using SFML with C::B here, just remember to compile SFML with the same gcc.

Navigation

[0] Message Index

[#] Next page

Go to full version