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

Author Topic: How to find the Static DLL's?  (Read 10868 times)

0 Members and 1 Guest are viewing this topic.

JTeck

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: How to find the Static DLL's?
« Reply #15 on: April 09, 2014, 04:21:59 pm »
Ok, now it's spat out an error at me

Error   1       error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::White" (?White@Color@sf@@2V12@B)
 

Thats using SFML_STATIC
and linking sfml-graphics-s-d.lib when building etc.

It also spits out this

Error   11      error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800' in game.obj
« Last Edit: April 09, 2014, 04:32:10 pm by JTeck »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: How to find the Static DLL's?
« Reply #16 on: April 09, 2014, 04:34:16 pm »
Using VS 2012 libraries with VS 2013 will not work.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

JTeck

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: How to find the Static DLL's?
« Reply #17 on: April 09, 2014, 04:40:16 pm »
Using VS 2012 libraries with VS 2013 will not work.

Well that stink's, my CMAKE I got earlier today doesnt even do VS 2013 :((

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: How to find the Static DLL's?
« Reply #18 on: April 09, 2014, 04:42:42 pm »
Using VS 2012 libraries with VS 2013 will not work.

Well that stink's, my CMAKE I got earlier today doesnt even do VS 2013 :((
Remember that VS 2013 is == VS v. 12 ;)
Blame MS for confusing versioning...

JTeck

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: How to find the Static DLL's?
« Reply #19 on: April 09, 2014, 04:44:24 pm »
Using VS 2012 libraries with VS 2013 will not work.

Well that stink's, my CMAKE I got earlier today doesnt even do VS 2013 :((
Remember that VS 2013 is == VS v. 12 ;)
Blame MS for confusing versioning...
Sweet, I built a up to date one then earlier :) Woo, lets test.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: How to find the Static DLL's?
« Reply #20 on: April 09, 2014, 07:07:49 pm »
Remember that VS 2013 is == VS v. 12 ;)
Even that is wrong ;)

Visual Studio 2013 (the IDE)
is the same as
Visual C++ 12 (the compiler)

And since that is not confusing enough, also the term "Visual C++ 2013 Express" is used to refer to the Express Edition of the IDE. The reasoning is that it only includes support for C++ and not other languages, so it's no studio ;)
« Last Edit: April 09, 2014, 07:13:03 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: How to find the Static DLL's?
« Reply #21 on: April 09, 2014, 07:10:01 pm »
Remember that VS 2013 is == VS v. 12 ;)
Even that is wrong ;)

Visual Studio 2013 (the IDE)
is the same as
Visual C++ 12 (the compiler)
Right you are. I should have double checked my memory.
I don't use Windows and related tools much. I guess it shows :(

Silvah

  • Guest
Re: How to find the Static DLL's?
« Reply #22 on: April 10, 2014, 03:19:44 pm »
Remember that VS 2013 is == VS v. 12 ;)
Even that is wrong ;)

Visual Studio 2013 (the IDE)
is the same as
Visual C++ 12 (the compiler)
Not really, no. Jesper Juhl isn't wrong, Visual Studio 2013 is very much Visual Studio version 12, as shown in its "About" dialog, which says
Quote
Microsoft Visual Studio Express 2013 for Windows Desktop
Version 12.0.30110.00 Update 1
This is also the major version of the bundled runtime libraries.

The compiler major version, however, is 18, as can be seen when invoking cl.exe directly:
Quote
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86

Getting this right can sometimes be important, for example when trying to detect VC++ 2013, because naively trying to do #if _MSC_VER == 1200 will fail, for the compiler version 12 is the one bundled with Visual Studio 6.0, released in 1998.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: How to find the Static DLL's?
« Reply #23 on: April 10, 2014, 05:18:09 pm »
You're right, maybe we should differentiate between version number and branding name.

On MSDN, Microsoft mostly refers to the IDE as "Visual Studio <year>", it's the name used for advertising. Because of that and the fact that people can relate better to a year than an abstract number, I think talking of Visual Studio 2013 instead of Visual Studio 12 leads to less confusion.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Daddi

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
    • http://foxdev.de/
    • Email
Re: How to find the Static DLL's?
« Reply #24 on: April 12, 2014, 01:33:24 am »
When you link statically on Windows you link against *.lib (VS) or *.a (MinGW) files. Now while they have the same file ending, it's not the same as the import libraries at all. SFML is helpful in that matter and provides the -s suffix. These static libraries actually contain all the code of the library. During the linking stage, the linker will look for the needed symbols in the static library and when used directly include it into the executable and since everything gets included there's no need for files such as *.dll.

I'd like to highjack the thread and ask a question: Why is the preprocessor flag SFML_STATIC necessary? Like you said, the "The linker is now happy and builds your executable" as long as he knows where to find the right code, may it be directly inside the lib or just linked into a .dll file. What does the preprocessor flag actually do?
« Last Edit: April 12, 2014, 01:35:06 am by Daddi »

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: How to find the Static DLL's?
« Reply #25 on: April 12, 2014, 01:47:32 am »
It conditionally defines macros that are later used in SFML headers called Export.hpp in all submodules folders and from there in all headers of each submodule.
If it's the SFML submodule itself being built they tell linker to export the symbols so they are visible from the outside.*
If it's another lib or program that uses SFML they'll tell linker to look around shared objects for implementation of the classes and functions defined in the SFML headers you included.
For static SFML all these macros actually do nothing since nothing special is needed for static linking.
See:
https://github.com/SFML/SFML/blob/master/include/SFML/Network/Export.hpp
https://github.com/SFML/SFML/blob/master/include/SFML/Config.hpp#L83

*I think these are actually what's inside .lib files in Windows but don't quote me on that...
Back to C++ gamedev with SFML in May 2023

 

anything