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

Author Topic: Building SFML for Visual Studio 2015  (Read 15548 times)

0 Members and 1 Guest are viewing this topic.

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
Building SFML for Visual Studio 2015
« on: July 22, 2015, 08:32:21 pm »
Hi,
i try to use Visual Studio 2015 tools to compile SFML. I do that by using cmake:
cmake -G"NMake Makefiles" C:\Libraries\SFML-2.3.1
nmake
But no matter whether i try to build SFML by nmake or by a sln, i allways getting the following unresolved symbols:
jpeg.lib(jerror.obj) : error LNK2001: unresolved external symbol _sprintf
jpeg.lib(jerror.obj) : error LNK2019: unresolved external symbol ___iob_func referenced in function _output_message
jpeg.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol _sscanf referenced in function _jinit_memory_mgr
in sfml-graphics-2.dll.
What i am doing wrong? Are the by SFML provided jpeg.lib incompatible to the VS15 libs?

kitteh-warrior

  • Guest
Re: Building SFML for Visual Studio 2015
« Reply #1 on: July 22, 2015, 08:37:38 pm »
Searching the forums would get you a solution, I believe.
If I recall correctly, Visual C++15 broke the C API?

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #2 on: July 22, 2015, 08:52:52 pm »
I don't find something, but http://en.sfml-dev.org/forums/index.php?topic=18243.msg131275#msg131275, he obviosly did it. But that's no help for me.

kitteh-warrior

  • Guest
Re: Building SFML for Visual Studio 2015
« Reply #3 on: July 22, 2015, 08:58:58 pm »

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #4 on: July 22, 2015, 09:08:24 pm »
Ok that Thread i didn't find about 3 hours googeling.
But god dam compiling jpeglib doesn't seems that easy.
« Last Edit: July 22, 2015, 09:12:14 pm by Reborn »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10998
    • View Profile
    • development blog
    • Email
AW: Building SFML for Visual Studio 2015
« Reply #5 on: July 22, 2015, 10:53:20 pm »
You can also use my "nightly" builds for VS 2015RC.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #6 on: July 24, 2015, 07:07:10 pm »
Thanks eXpl0it3r for that hint.

But i now compiled each of the extlibs by my self. Now the linker can resolve the symbols correctly. But i have two more questions better said 1 question and 1 problem:
1. the question:
if i download a SFML Visual Studio build, for instance the Visual Studio 2013 build, i allways only have 1 build for the extlbis. I don't understand why only one build? What happens if the extlibs are compiled with the option /MD and the Exectuable with /MDd? Whouldn't appear some symbol conflicts in that case?

2. the problem:
if SFML creates a GLContext i get the fallowing warning message in the contex-check-SFML-function:
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 1.1 ; depth bits = 0 ; stencil bits = 0 ; AA level = 32 ; core = false ; debug = false
Created: version = 4.5 ; depth bits = 0 ; stencil bits = 0 ; AA level = 16 ; core = false ; debug = false
Why OpenGL can't setup the context correctly?
« Last Edit: July 24, 2015, 07:09:00 pm by Reborn »

Klaim

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #7 on: July 24, 2015, 08:03:06 pm »
Last time I compiled SFML with VS2015, the only issue was that the dependencies binaries (which are in the repository???) are built with another compiler, so link errors.

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #8 on: July 24, 2015, 08:07:29 pm »
I wrote that i compiled each of the extlibs by my self. I haven't any linker errors anymore.

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: Building SFML for Visual Studio 2015
« Reply #9 on: August 10, 2015, 09:38:51 am »
The nightly builds for VS 2015RC work just fine with the community version of VS 2015, without compiling anything yourself. Thanks to eXpl0it3r, to keep them updated!
Failing to succeed does not mean failing to progress!

zerOpRiME

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #10 on: August 11, 2015, 08:10:02 pm »
Unfortunately using the nightly build did not resolve my issues- I still get vcruntime140 errors.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #11 on: August 12, 2015, 09:19:24 am »
Mind copying the exact error message, if you haven't done so?

zerOpRiME

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #12 on: August 12, 2015, 01:30:43 pm »
The error message was 'vcruntime140.i386.pdb not loaded'

After some reading I assumed this was due to the vs2015 change in the C runtime libraries that I have read about in other threads.

Unfortunately I have uninstalled vs2015 at this point and am in the process of installing vs2013 to get SFML up and running on my laptop.  I do have some vs2015 debug files saved and I can send them over if they can help (VC++ Minimum Rebuild Dependency File (.idb) and Program Debug Database (.pdb) files).  As you can tell I am a novice so thanks for being patient!

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: Building SFML for Visual Studio 2015
« Reply #13 on: August 12, 2015, 02:28:32 pm »
If you did not change anything from VS and did not build anything yourself (also not the extlibs) it should work just fine, as I tried it with a fresh installation of VS2015 and the 32 bit nightly builds for VS2015RC. Just added the paths for the include and lib folders, plus the linker dependecies as explained in the tutorials, and it worked perfectly.
Failing to succeed does not mean failing to progress!

zerOpRiME

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Building SFML for Visual Studio 2015
« Reply #14 on: August 12, 2015, 03:42:08 pm »
Mine worked perfectly as well for certain code- for instance, the code within the VS setup tutorial worked fine.  However when I tried more in depth tutorials such as the link below I started receiving the vcruntime errors.

I have not changed anything in VS nor have I built anything myself.

(the code at the very bottom):
https://riseagain.wordpress.com/2012/07/15/sfml-2-tutorial-introduction/

 

anything