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

Author Topic: getting SFML to work with Visual Studio 2010  (Read 2669 times)

0 Members and 1 Guest are viewing this topic.

BoomPony

  • Newbie
  • *
  • Posts: 2
    • View Profile
getting SFML to work with Visual Studio 2010
« on: February 28, 2011, 12:06:14 pm »
Hi everyone,

I can't seem to get SFML working with VS 2010, I'm just trying to get the first tutorial up and running, using sf::Clock

http://www.sfml-dev.org/tutorials/1.6/start-vc.php

I've added the include and lib directories to VC++ Directories, defined SFML_DYNAMIC in preprocessor definitions, converted the solution and rebuilt the libs in VS 2010, and linked to 'sfml-system-d.lib' in Linker->Input->Additional Dependencies, then copied the sfml-system-d incremental linker file and the sfml-system-d.dll application extension to the directory of my project.

I get the error message: error LNK1104: cannot open file 'sfml-system-d.lib'

I have seen so many posts containing problems like this but none of them seem to contain the solution to my problem as far as I can see, sorry for throwing another one into the mix.

Thanks x

Relic

  • Newbie
  • *
  • Posts: 43
    • View Profile
getting SFML to work with Visual Studio 2010
« Reply #1 on: February 28, 2011, 04:16:10 pm »
Quote
...and rebuilt the libs in VS 2010

1. Did you re-build all sfml dependensies in vs2010 as well?
2. I think, you should add the path to your sfml-system-d.lib in the project settings /Linker->General->Additional Library Directories/.

BoomPony

  • Newbie
  • *
  • Posts: 2
    • View Profile
getting SFML to work with Visual Studio 2010
« Reply #2 on: February 28, 2011, 04:37:47 pm »
1 - I built all of the libraries, what do you mean by rebuilding the dependencies?  

2 - Do you mean the SFML-1.6\lib\vc2008 folder? I tried that but nothing changed, was the point of that to tell it where sfml-system-d.lib is located? I copied sfml-system-d.lib to my project's directory so I didn't think I would need to do that.

Relic

  • Newbie
  • *
  • Posts: 43
    • View Profile
getting SFML to work with Visual Studio 2010
« Reply #3 on: February 28, 2011, 05:48:42 pm »
1. To be more precise, there is one dependency for SFML-1.6 that must be re-built in vs2010. Sfml-graphics library depends on freetype.lib and is statically linked to it. Thus it must be rebuilt. Other dependencies /openal32.lib and sndfile.lib for sfml-audio library/ are linked dynamically and may be used "as is".
2. I mean that the linker must know where to find sfml-sytem-d.lib. Using linker section in project settings you can set up the right path to the library. I don't think it's a good practice to move *.lib files to a project's folder. You'll get lots of copies of the same file scattered here and there if you have more than one project.

 

anything