Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] Libraries Query  (Read 768 times)

0 Members and 1 Guest are viewing this topic.

iHutch105

  • Newbie
  • *
  • Posts: 3
    • View Profile
[SOLVED] Libraries Query
« on: February 05, 2013, 10:22:31 pm »
Hi,

I'm pretty new to SFML and I have a slight libraries issue I was hoping someone could help with.

As a little background info, I'm using SFML as part of a university project, which I'm developing at home and must present at university. Since I don't have administrative rights on the university machines, I need to make this program as self-contained as possible.

I can currently get SFML running with, what I thought was, static libraries but when I ran it on another laptop to test, it complained about sfml-xxx-2.dll being missing. I resolved this by adding the required dlls to the sysWOW directory. However, I'm afraid that I might not be able to do that when the time comes to present the project.

I'm using VS2012, with the following setup (I'll give Release info only):
1 - C/C++ -> General -> Additional Include Directories: C:\SFML\Include   
2 - Linker -> General -> Additional Library Directories: C:\SFML\lib
3 - Linker -> Input -> Additional Dependencies: sfml-xxxx.lib (where 'xxxx' = graphics/audio etc)

When I originally created the project, I had the libraries installed in the directories for points 1 and 2. I've now moved them to the project directory and it builds fine. However, when I try to run it, I get the message about the missing dll (graphics, in this case, but I'm assuming if I add graphics it'll just pop up with an error for one of the others).

I tried adding a preprocessor definition of SFML_STATIC but that gives a bunch of unresolved external errors at compile time. I've tried going through the tutorials, but the seem to differ. I'm not sure which is correct, to be honest. One hints that extra settings needed to be added for the use of the dynamic libraries, the other suggests the same for static.

The only other info I can think of worth mentioning is that I compiled SFML using CMake and VS2012.

Apologies for the long post - it wasn't intended when I set out writing it - and thanks in advance for any advice.
« Last Edit: February 05, 2013, 10:59:28 pm by iHutch105 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Libraries Query
« Reply #1 on: February 05, 2013, 10:27:00 pm »
Doesn't the tutorial say that static libraries are the files with a "-s" suffix (sfml-xxx-s.lib)?
Laurent Gomila - SFML developer

iHutch105

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Libraries Query
« Reply #2 on: February 05, 2013, 10:39:00 pm »
Indeed it does, but as far as I can see no such files have been generated. Presumably I've done something wrong when I've built the solutions that CMake generated.  I've got the sfml-xxxx.lib files, the sfml-xxxx-2.dll files and the sfml-xxxx.exp files.

A twofold thanks to you, by the way, Laurent. The first for the speedy response, the second (and by no means least) for your continued efforts on this library.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Libraries Query
« Reply #3 on: February 05, 2013, 10:45:48 pm »
You built the dynamic libraries. You must uncheck the BUILD_SHARED_LIBS CMake option when you configure your solution, to generate the static variant of SFML libraries -- this is also explained in the tutorial.
Laurent Gomila - SFML developer

iHutch105

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Libraries Query
« Reply #4 on: February 05, 2013, 10:47:38 pm »
Ah dear, I completely misread that option.

My apologies.

Thanks, Laurent.