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

Author Topic: Building SFML 2.0-rc for use with VS2012  (Read 6404 times)

0 Members and 1 Guest are viewing this topic.

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Building SFML 2.0-rc for use with VS2012
« on: March 15, 2013, 09:46:29 pm »
Greetings. I switched IDEs, and after trying out JSFML, I figured knowing how to build things will be useful in the future, such as if I ever try a Linux distribution.

Anyway, I am now using Visual Studio (I don't need to hear whether or not it sucks). In this case, 2012, which apparently is actually version 11. Anyway,  the RC had libs for 2010, but I got the different versions of it error. So, I was on a quest to build it.

After downloading the snapshot from the download page (with the source), and followed the tutorial for 2.0 using cmake. I made a Visual Studio Win64 project (on 64-bit system). I was able to  build it in Release and Debug, which generated the debug and non-debug DLLS, as well as the static dll-initializing/loading libraries (without the s).

But there were no static builds. I asked around, and I heard there were supposed to be other build options, namely Debug-Static and Release-Static, but they are not listed in VS2012 in build -> configuration manager -> active solution configeration. Listed is Release, Debug, MinSizeRel and RelWithDebInfo.

How can I make the static libraries? I don't think this would make a difference according to the wording of the tutorial, but CMAKE_BUILD_OPTION was Release.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #1 on: March 15, 2013, 10:52:06 pm »
Quote
In this case, 2012, which apparently is actually version 11
2012 is the version of the IDE (Visual Studio), a year.
11 is the version of the compiler (Visual C++), an incremental number.

Quote
How can I make the static libraries?
Tutorial -> ctrl + F: "static" -> high density of results around this paragraph:
Quote
BUILD_SHARED_LIBS
This boolean option controls whether you build the dynamic (shared) libraries of SFML, or the static ones.
... awesome! ;)
« Last Edit: March 15, 2013, 10:55:41 pm by Laurent »
Laurent Gomila - SFML developer

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #2 on: March 15, 2013, 11:18:50 pm »
Ah... the stench if my ignorance burns, it is so bad this time :)

I think, in hindsight, I missed it. For whatever reason, I was comparing the list there with mine, and expected to see it in the middle, while it was on the top of the list (in cmake-gui). Pretty bad failure, there.

I seem to have the static libs now, except... one. In the release build, there are four of each: the DLL, the exp file (not sure what this is for, will ignore it), the .lib file, and the -s.lib file. Except... window has three. It only has the DLL, exp, and .lib, but no -s.lib. Am I missing something?

I tried to re-run it, but visual studio does not want to rebuild (up to date). I tried changing a comment line, and it re-ran then, but still no -s.lib for window.

Is this normal?


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #3 on: March 15, 2013, 11:21:41 pm »
No, you should have all libs regardless of the chosen configuration. Any error message? What happens when you right clic on the sfml-window project, and select "Project only" > "Rebuild"?
Laurent Gomila - SFML developer

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #4 on: March 15, 2013, 11:36:27 pm »
Hm... when I did that, it gave me the window-s.lib this time, but seemingly deleted the other three. So I ran it again the shared way, and now got all four of everything.

Added include/lib paths, added dependencies... defined SFML_STATIC...

and got a boatload of unresolved external system errors related to any SFML object I used. Apparently I screwed up. What now?



I doubt this error will help, but who knows, so here is one of them:

Error   1   error LNK2019: unresolved external symbol "public: float __thiscall sf::Time::asSeconds(void)const " (?asSeconds@Time@sf@@QBEMXZ) referenced in function _main   (path\filename.obj here)   Pong




eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #5 on: March 16, 2013, 01:33:00 am »
Are you linking against sfml-system-s(-d)?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #6 on: March 16, 2013, 01:43:47 am »
Yes - sfml-system-s-d.lib, specifically, in additional dependencies. It finds the file, so... I beleive the .lib part is correct.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #7 on: March 16, 2013, 01:55:13 am »
Hmmm... I don't really know what's the problem. Somewhere along the line you must have made a mistake, but it's not easy to tell.
My Nightly Builds work fine with VS2012, so you can be sure, that it's not the IDE/compiler. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #8 on: March 16, 2013, 02:10:06 am »
That is the thing. I tried it with those... same errors. Which I hope is it, because if I built them wrong, I have no idea where. But I don't know what it could be. I followed the tutorial to a T - adding the paths - and I know that works - specifying SFML_STATIC for the preprocessor, and adding the libraries in dependencies. It finds those files... I don't know what else there could be.

I tried taking pictures of the subwindows in VS, but it only grabs the main window instead.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #9 on: March 16, 2013, 09:07:13 am »
You can upload your project file if you want, I'll take a look.
Laurent Gomila - SFML developer

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #10 on: March 16, 2013, 02:24:50 pm »
http://www.mediafire.com/?2x59c9aw4bpxxzk - project file.

Note, in this case, that the SFML-vs-real directory is from the nightly builds for the appropriate case (VS2012, most recent). I was trying to see if it fixed it or not, same error. Otherwise, the built ones were in the normal location in SFML-VS, as well as the include as the nightly builds don't have it, and I don't think ALL of the API changed. Or, at least, that is not the error, I hope.


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #11 on: March 16, 2013, 04:17:04 pm »
The .sln file is the solution file, it just has links to the projects. The project file is vxproj or whatever (I don't know for 2012).
Laurent Gomila - SFML developer

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #12 on: March 16, 2013, 04:57:59 pm »
Oh. Sorry. For some reason, I reused, partially accidentally, an old project folder of Pong (from minGW and C::B). Apparently, there was a Pong folder WITHIN the Pong folder, which had the project file. There were just vs-related files in the upper directory as well.

http://www.mediafire.com/?re2m17t9r37ar4k

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #13 on: March 16, 2013, 05:04:56 pm »
It looks ok. Except that you shouldn't link to debug libraries (-d) in release configuration, but that doesn't explain your problem.
Laurent Gomila - SFML developer

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #14 on: March 16, 2013, 05:09:54 pm »
Ah. I had been, but while looking through the VS setup for the fifth time, it occured to me, what if I had set them for debug but was on release, so I tried that. No fix, unfortuately.

So if this is linked correctly... what gives? I linked to the nightly builds as well as my own, and neither worked... does it work for you?

 

anything