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

Author Topic: Building/Compiling agaisnst static libs with SFML2  (Read 2252 times)

0 Members and 1 Guest are viewing this topic.

Gibgezr

  • Newbie
  • *
  • Posts: 33
    • View Profile
Building/Compiling agaisnst static libs with SFML2
« on: February 17, 2011, 08:28:33 pm »
OK, I've got a little issue: I can't seem to get SFML 2 to link statically.

I'm using VS 2008 and VS 2010, depending on which machine I happen to be at.

I've sussessfully downloaded the SVN, run cmake, and can build release and debug versions of the libraries (there are no longer any options for making "static" versions of these, which I assume is OK).

In my test app, I've defined the preprocessor directive SFML_STATIC under configuration properties->C/C++->Preprocessor->Preprocessor Definitions.

I have removed paths to SFML 1.6 from my compiler, so as to make sure it isn't getting confused as to what version I am building against.

It builds the app fine, but when I run it, I get a windows message box telling me that it can't find sfml-graphics-d.dll.

Am I missing something? I thought to build static lib versions of apps under SFML 2, I just had to have SFML_STATIC defined.

devlin

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Building/Compiling agaisnst static libs with SFML2
« Reply #1 on: February 17, 2011, 08:35:40 pm »
No, under cmake (possibly cmake -i) you have to make sure it's built as static - as you're obviously not linking to the static (-s) libraries.

I would suggest taking the time to actually read what's there :)

Code: [Select]
Variable Name: BUILD_SHARED_LIBS
Description: TRUE to build SFML as shared libraries, FALSE to build it as static
 libraries
Current Value: TRUE
New Value (Enter to keep current value):



And in the tutorial:
http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

It explicitly says:
BUILD_SHARED_LIBS
This boolean option controls whether you build the dynamic (shared) libraries of SFML, or the static ones.

I.e., you'll have to recompile. :)  Better luck next try! :)

Gibgezr

  • Newbie
  • *
  • Posts: 33
    • View Profile
Building/Compiling agaisnst static libs with SFML2
« Reply #2 on: February 17, 2011, 11:11:30 pm »
Thanks, that fixed the problem!

I must admit to skipping through the cmake tutorial doc and skimming it too quickly, making the (obviously incorrect) assumption that pounding on configure twice and hitting generate was all that was needed. Silly me :P

 

anything