Linking in VS 2013

I recently got Windows 7 and I can't get visual studio to link for the life of me.

Trying to get SFML working, which I've compiled from source. The example executables work just fine.

I've followed the steps on this page:
http://www.sfml-dev.org/tutorials/2.0/start-vc.php

I get link errors for the obvious things, sf::RenderWindow(), sf::VideoMode(), sf::String().

Thinking maybe it was an SFML thing, I build SDL too. Same problems.

Thinking I simply missed a step in VS, I used CMake to build the solution for me, no luck.

Has anyone used VS 2013 ( 64bit ) and can tell me how to get this thing to link?

Another thing, if I spell the libraries wrong on purpose, I get the error that the libraries can't be found. To me, this means that when I spell them right, they are found. That means that VS is finding the libs, it's just not freaking linking them!

Are you linking statically? I have found SFML and VS2013 don't really play well when trying to link statically and it takes quite a bit of work to get it to work. I might be able to help guide you the through the process through the process if that is the case, though it would probably be a lot easier to link dynamically to them.

Though could you paste the exact errors you are getting in a pastebin, might give some clue as to the problems.
Thanks. While putting together some answers I got it to link dynamically. I had a 32bit project, but I compiled SFML 64bit. This makes me wonder why the CMake attempt didn't work, I'm sure that was a 64bit project.

Static linking does appear to be some work though, I get link errors with at least glew. I'll have to download it at some point, I guess.

When I do download it, and for the libraries/headers in SFML, do you have a suggestion for where I should put them? So far I just made a folder in My Documents with separate include and lib directories.

One more thing, sfml-main. I'm not linking to it, it gets named the same for both dynamic and static builds ( but has different file sizes ), do I need it?
One more thing, sfml-main. I'm not linking to it, it gets named the same for both dynamic and static builds ( but has different file sizes ), do I need it?


Depends on your preference. It is mainly there so you don't have to use the standard WinMain entry point and can instead use main() as the entry instead.

Thanks. While putting together some answers I got it to link dynamically. I had a 32bit project, but I compiled SFML 64bit. This makes me wonder why the CMake attempt didn't work, I'm sure that was a 64bit project.


Yeah same thing happened to me. CMake wouldn't complain just because it is using the 64 bit compiler to build the SFML library and that is it. Which then produces a 64bit binary which isn't compatible with your 32bit project.

When I do download it, and for the libraries/headers in SFML, do you have a suggestion for where I should put them? So far I just made a folder in My Documents with separate include and lib directories.


Doesn't really matter to much where you put them. I usually keep a central storage of all my libraries that I have and update them every now and then. Then whenever I create a project I just copy the ones I need over to the project folder to use.
Registered users can post here. Sign in or register to post.