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

Author Topic: VS 2017 Static & Dynamic problems with 2.4.2  (Read 14084 times)

0 Members and 1 Guest are viewing this topic.

AshleyF

  • Newbie
  • *
  • Posts: 30
    • View Profile
VS 2017 Static & Dynamic problems with 2.4.2
« on: July 26, 2017, 07:39:01 pm »
Dear All,

I am having major problems with VS Community 2017 and 2.4.2 32-bit.

I follow the installation instructions to the letter, but it just will not work.

I've used CMake on the 32-bit source code, but that also doesn't work.

Does anyone happen to have any idea when a VSC 2017 specific stable release will be available please?

Kind regards,

AshleyF

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #1 on: July 26, 2017, 08:41:38 pm »
SFML works fine with Visual Studio 2017.

If you don't manage to create working builds on your own, I would in a first step recommend you try until you understand the error and manage to build SFML. It might be frustrating and time consuming, but learning you basic programming tools is simply a must. ;)
If you're under time pressure, you can always grab my "nightly" builds.

Also "doesn't work" is not a problem description. If you want help with your problem, you first need to describe it properly. Thinking about the problem also often leads to understanding it better and maybe solve it on your own. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Wafthrudnir

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #2 on: July 27, 2017, 01:48:34 am »
I am using the latest SFML source and build it with Visual Studio 2017 and everything works fine. I once had a problem with msbuild because I had VS 2013 professional and VS 2017 community installed. I uninstalled everything but nothing worked...I resetted my windows 10 and reinstalled 2017. Problem solved (I work daily with VS and the way it's installed on a machine is just annoying).

What problem do you exactly have? What does CMake say? Or visual studio?!
Black Metal + Coding = Win!

AshleyF

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #3 on: July 28, 2017, 11:23:49 pm »
Dear eXpl0it3r,

Thank you very much for your reply.

After downloading your nightly build and repeating the installation, I have discovered that:

1) The dynamic configuration works absolutely fine; but

2) The static configuration does not compile.

I have used both the 'lib' and 'static-std' in the project configuration setup and always receive the following compiler error message, this being the first one, with many others along the same lines:

LNK2019 unresolved external symbol __imp__wglShareLists@8 referenced in function "private void __thiscall sf::private::WglContext::createContext(class sf::private::WglContext *)" (?createContext@WglContext@priv...

and so the error message continues.

Any suggestions to overcome this problem would be most gratefully received.

Kind regards,

AshleyF

Arcade

  • Full Member
  • ***
  • Posts: 230
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #4 on: July 28, 2017, 11:37:14 pm »
Quote
Starting from SFML 2.2, when static linking, you will have to link all of SFML's dependencies to your project as well. This means that if you are linking sfml-window-s.lib or sfml-window-s-d.lib for example, you will also have to link opengl32.lib, winmm.lib and gdi32.lib.

Did you do this step, as described in the SFML tutorials?

JayhawkZombie

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #5 on: July 28, 2017, 11:38:33 pm »
Are you linking all the libs?
I'm using the same version of visual studio as you, and I have these linked:
  • sfml-graphics-s-d.lib
  • sfml-window-s-d.lib
  • sfml-audio-s-d.lib
  • sfml-system-s-d.lib
  • flac.lib
  • freetype.lib
  • jpeg.lib
  • ogg.lib
  • openal32.lib
  • vorbis.lib
  • vorbisenc.lib
  • vorbisfile.lib
  • opengl32.lib
  • winmm.lib
  • sfml-main-d.lib

(someone already mentioned the need to link all the dependencies as well before I finished this)

AshleyF

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #6 on: July 29, 2017, 12:21:17 am »
Dear JayhawkZombie,

Thanks very much for your reply.

Other than opengl32.lib, winmm.lib and gdi32.lib, all of the other libs are present.

After searching the hard drive and finding that they are not present, I googled for an answer.

It appeared to be the case that I'd need to install the latest Windows SDK.

I did that, and those libs still are not present anywhere.

Any advice would be most gratefully received.

Kind regards,

AshleyF

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #7 on: July 29, 2017, 12:47:25 am »
You don't need to "find" them on your harddisk. You just need to link them. Those are system libraries and your compiler will find them on its own. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

AshleyF

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #8 on: July 29, 2017, 01:26:31 am »
Dear All,

After reconfiguring the preferences in accordance with the advice given, I have discovered that:

1) A release build can compile, link and execute; but

2) A debug build cannot compile due to linker errors.

The error messages start with:

LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj

Any advice will be most gratefully received!

Kind regards,

AshleyF

JayhawkZombie

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #9 on: July 29, 2017, 02:09:56 am »
Try manually defining _ITERATOR_DEBUG_LEVEL.

Project > Properties > Configuration Properties > C/C++ > Preprocessor

and add '_ITERATOR_DEBUG_LEVEL=0' to the 'Preprocessor Definitions' section.  Microsoft has more info here about the macro https://docs.microsoft.com/en-us/cpp/standard-library/iterator-debug-level

AshleyF

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #10 on: July 29, 2017, 03:53:33 pm »
Dear JayhawkZombie,

Thanks for the suggestion.

Although the linker error count has now come down to 33-ish, the new error being reported is:

LNK2038   mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in main.obj

Any suggestions would be most gratefully received.

Kind regards,

AshleyF

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #11 on: July 29, 2017, 04:28:53 pm »
The other suggestions for the iterator is not a fix for the root cause, but hack to make some symptoms go away.

You're either either linking the release SFML libs in debug mode or you've set the runtime lib to MD instead of MDd for your debug settings.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

AshleyF

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #12 on: August 01, 2017, 12:29:34 am »
Dear eXpl0it3r,

From the VSC 2017 SFML build I downloaded that you made, there are two folders containing the relevant files.

I've tried each folder under both build options and still get the same error.

Any suggestions would be most gratefully received.

Kind regards,

AshleyF

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #13 on: August 01, 2017, 12:52:18 am »
It's your project settings, as I already said.

You're either either linking the release SFML libs in debug mode or you've set the runtime lib to MD instead of MDd for your debug settings.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

AshleyF

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: VS 2017 Static & Dynamic problems with 2.4.2
« Reply #14 on: August 01, 2017, 04:19:41 pm »
Dear eXpl0it3r,

Thanks very much for you reply.

Unfortunately, after trying everything you suggested, and checking and verifying everything you specified, it still isn't working :(

Any advice would be most gratefully received.

Kind regards,

AshleyF

 

anything