0

I'm trying to link SFML2.3.1 in Codelite 9.1.3. I'm using Windows 10, 64 bit. I did everything according to this tutorial http://en.sfml-dev.org/forums/index.php?topic=18820.0. I did the Include Paths, the Library Paths, entered the libraries including the dependencies in the correct order. A lot of other people have asked similar questions and I've tried all the solutions offered there-Linking SFML in CodeLite - and several others. Here's the error I get:

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-64/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ CodeLiteProject - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/Benjamin/Documents/sfml/CodeLiteProject'
C:/TDM-GCC-64/bin/g++.exe -o ./Debug/CodeLiteProject @"CodeLiteProject.txt" -L. -LC:/SFML-2.3.1/lib  -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lsfml-audio-s -lsfml-network-s -lopengl32 -lfreetype -ljpeg -lwinmm -lgdi32 -lopenal32 -lws2_32
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib\libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-graphics-s

And it repeats those same last four lines for each library (skipping incompatible - cannot find). Then after all that it says this:

collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/CodeLiteProject] Error 1
CodeLiteProject.mk:78: recipe for target 'Debug/CodeLiteProject' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/Benjamin/Documents/sfml/CodeLiteProject'
mingw32-make.exe: *** [All] Error 2

All I've ever really done with a compiler before is hit "Build and Run", so I really appreciate any help. Also, I've tried every different variation of ways of entering the libraries (-l*, *-s, *-s-d, *.lib, *.a, etc.)

Community
  • 1
  • 1
Benjaminf
  • 3
  • 3

2 Answers2

0

It doesn't appear that you're linking the debug SFML libs, yet the project is being built in Debug mode. Append "-d" to the end of the SFML lib names when building in Debug, e.g.:

/TDM-GCC-64/bin/g++.exe -o ./Debug/CodeLiteProject @"CodeLiteProject.txt" -L. -LC:/SFML-2.3.1/lib  -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lsfml-audio-s-d -lsfml-network-s-d ... 
PowerGlove
  • 157
  • 1
  • 4
0

This line:

C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s

This error usually means that you have an arch differences, i.e. your code is compiled as a 64 bit application, while the SFML libraries are built as 32 bit library.

Try using SFML libraries that are built with a 64 bit compiler (preferably using the same compiler as the one you are using - TDM-GCC 64 bit/v5.1)

Eran
  • 2,310
  • 1
  • 13
  • 13
  • So I did that, and I guess I'm progress. I guess it's linking now but it's saying the application was unable to start and gives me error code 0xc000007b. This has to do with the same issue, some sort of conflict between 32bit and 64bit. All the references I see are from games not starting. I'm working through all the solutions I can find but so far nothing. – Benjaminf Mar 12 '16 at 04:11
  • The answer remains: you are mixing 32 and 64 DLLs. Use dependency walker to check which one. Note that you should use the 64 bit version of the dependency walker – Eran Mar 12 '16 at 05:01