0

I'm trying to statically link SFML, which requires linking all other dependencies. On the SFML tutorial page it states that all dependencies are provided along side it, but I genuinly couldn't figure out any way to link them. Other dependencies seem to work just fine (or they just don't produce linker errors yet). I also tried manually downloading freetype, building it, but that just left me in a bigger mess of files, and as a beginner, I really can't follow anything what's going on. My "Link libraries" look like this:

enter image description here

And I tried putting the directory of the header files (I could only find the header files, nothing else, no .a or .so files, not sure if that's the problem) in various places in the search directories.

Closest thing to my problem I found was this, but I really couldn't get anything out of this...

P.S. I'm on Windows, using Code::Blocks, GCC 7.3.0, custom built SFML with CMake for my compiler aswell. Unless I missed something in tutorials, I don't think I missed anything. Without static linking, everything worked fine. I didn't forget SFML_STATIC in #defines either. I don't know what else to add, if there is something missing, please tell me.

I'm at a loss for a couple of days here, any help would be appreciated, even if it's some harsh critique because of missing a simple detail :P

Nedas Bolevičius
  • 311
  • 1
  • 2
  • 10
  • And do you have the free type library installed? – Matthieu Brucher Dec 25 '18 at 16:46
  • Well, as I said, it should be provided along side SFML. Either way, I did try to manually install it, but still somewhere made an error... – Nedas Bolevičius Dec 25 '18 at 16:49
  • I don't think SFML will provide all their third party dependencies, it's up to you to provide them. If you install them manually, you need to provide it with the same compiler (or a compatible one). – Matthieu Brucher Dec 25 '18 at 17:04
  • "On Windows and macOS, all the required dependencies are provided alongside SFML so you won't have to download/install anything else" (stated in the tutorial page). The files are inside "extlibs" in the source code. I'm pretty sure those should work, but they don't. – Nedas Bolevičius Dec 25 '18 at 17:07
  • In that case, did you add the folder `extlibs` to the link path? – Matthieu Brucher Dec 25 '18 at 17:09
  • "And I tried putting the directory of the header files (I could only find the header files, nothing else, no .a or .so files, not sure if that's the problem) in various places in the search directories." – Nedas Bolevičius Dec 25 '18 at 17:15
  • 2
    I'm talking about the link path, not the header path. And yes, you should have a .a or .lib if the library was indeed installed. – Matthieu Brucher Dec 25 '18 at 17:16
  • Alright, after rebuilding things with CMake and realizing there is actually an install path, I found the .a files... but now I'm getting "undefined reference, but from what I can tell now I have included pretty much everything.. – Nedas Bolevičius Dec 25 '18 at 17:41
  • The name of the libraries should tell you which are missing, and check also the include order as well. – Matthieu Brucher Dec 25 '18 at 17:53
  • Yes, out of topic, but more or less for SO, because it would a duplicate. This seems like C++ standard libraries missing (linking with gcc instead of g++?) and possibly libunwind. – Matthieu Brucher Dec 25 '18 at 18:13

1 Answers1

0

The solution to this specific problem for me was simply rebuilding SFML with CMake again, because for some reason the install path (Program Files x86\SFML\..) wasn't actually created, and that's where all the .a files were. Including those in the search directories fixed the cannot find -lfreetype problem.

Nedas Bolevičius
  • 311
  • 1
  • 2
  • 10