Author Topic: Problem with SFML 2.0 libraries  (Read 655 times)

Offline Qday

  • Single posting newcomer
  • *
  • Posts: 4
Problem with SFML 2.0 libraries
« on: May 27, 2024, 06:18:17 am »
Hi, im trying to learn SFML2.0 with this tutorial: https://cpp0x.pl/kursy/Kurs-SFML-2-x-C++/460 (its in polish) and i cant get to it to work. Tried with empty project and with SFML wizard build in CodeBlocks.

tried with SFML 2.0 GCC 4.7 MinGW (DW2) - 32-bit and SFML 2.0 GCC 4.7 TDM (SJLJ) - 32-bit but still getting the same error message.

I have tried changing names of the libraries( deleting .a and "lib" but it doesnt work :(

screanshoots in the zip.

||=== Build: Debug in SFML_04 (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lsfml-graphics-d: No such file or directory|
ld.exe||cannot find -lsfml-window-d: No such file or directory|
ld.exe||cannot find -lsfml-system-d: No such file or directory|
||error: ld returned 1 exit status|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|




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

g++.exe -LC:\Dev\SFML-2.0\lib -o bin\Debug\SFML_04.exe obj\Debug\main.o   -lmingw32 -luser32 -lgdi32 -lwinmm -ldxguid -lsfml-graphics-d -lsfml-window-d -lsfml-system-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-graphics-d.a when searching for -lsfml-graphics-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib\libsfml-graphics-d.a when searching for -lsfml-graphics-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-graphics-d.a when searching for -lsfml-graphics-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-graphics-d: No such file or directory
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-graphics-d.a when searching for -lsfml-graphics-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-window-d.a when searching for -lsfml-window-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib\libsfml-window-d.a when searching for -lsfml-window-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-window-d.a when searching for -lsfml-window-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-window-d: No such file or directory
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-window-d.a when searching for -lsfml-window-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-system-d.a when searching for -lsfml-system-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib\libsfml-system-d.a when searching for -lsfml-system-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-system-d.a when searching for -lsfml-system-d
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-system-d: No such file or directory
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\Dev\SFML-2.0\lib/libsfml-system-d.a when searching for -lsfml-system-d
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
4 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 



Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1596
Re: Problem with SFML 2.0 libraries
« Reply #1 on: May 27, 2024, 11:21:07 am »
You are mixing 64 and 32-bit objects, or SFML was compiled with a different compiler.

Offline nenin

  • Almost regular
  • **
  • Posts: 227
Re: Problem with SFML 2.0 libraries
« Reply #2 on: May 27, 2024, 04:18:04 pm »
Hi, im trying to learn SFML2.0 with this tutorial:
4 error(s), 0 warning(s) (0 minute(s), 1 second(s))
You probably have to try this "GCC 13.1.0 MinGW (SEH) - 64-bit" from here  https://www.sfml-dev.org/download/sfml/2.6.1/  or check msys for  SFML2.
Versions you tried are totally outdated.

Offline Qday

  • Single posting newcomer
  • *
  • Posts: 4
Re: Problem with SFML 2.0 libraries
« Reply #3 on: June 04, 2024, 02:39:26 pm »
Quote
You probably have to try this "GCC 13.1.0 MinGW (SEH) - 64-bit" from here  https://www.sfml-dev.org/download/sfml/2.6.1/  or check msys for  SFML2.
Versions you tried are totally outdated.

Thanks, it worked but now i have a diffrent problem :( maybe u can help me with this one to ?

Offline nenin

  • Almost regular
  • **
  • Posts: 227
Re: Problem with SFML 2.0 libraries
« Reply #4 on: June 04, 2024, 02:57:24 pm »
Quote
You probably have to try this "GCC 13.1.0 MinGW (SEH) - 64-bit" from here  https://www.sfml-dev.org/download/sfml/2.6.1/  or check msys for  SFML2.
Versions you tried are totally outdated.

Thanks, it worked but now i have a diffrent problem :( maybe u can help me with this one to ?
How did you link this DLL? Directly or using *.a file?

Offline Qday

  • Single posting newcomer
  • *
  • Posts: 4
Re: Problem with SFML 2.0 libraries
« Reply #5 on: June 04, 2024, 03:58:34 pm »
Quote
How did you link this DLL? Directly or using *.a file?

I dont know the terminology but the dll is in the same folder as my .exe file

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: Problem with SFML 2.0 libraries
« Reply #6 on: June 04, 2024, 06:23:45 pm »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline nenin

  • Almost regular
  • **
  • Posts: 227
Re: Problem with SFML 2.0 libraries
« Reply #7 on: June 05, 2024, 07:40:09 am »
Quote
How did you link this DLL? Directly or using *.a file?

I dont know the terminology but the dll is in the same folder as my .exe file
exe found dll, but dll did not provide required function. It means that you linked incorrect dll. Linking of the dll can be done in few manners for mingw gcc:
1. Static using interface lib with extension *.a
2. Static using dll by itself (from my experience  it is better)
3. Dynamic by call dll and function from the code.
Something is wrong in your case.