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

Author Topic: Other people can't run my programs...  (Read 10010 times)

0 Members and 1 Guest are viewing this topic.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Other people can't run my programs...
« Reply #15 on: August 14, 2013, 05:14:48 pm »
The problem is that GLEW assumes it exists once per application. SFML includes GLEW inside its graphics module, but does not allow access to it from outside, so in SFGUI, we can't use GLEW because it will clash with the built-in SFML GLEW although ironically, this happens although we can't access it anyway. This clash however, only happens when mixing link types because of the initialization order being different for static libraries and dynamic libraries. It is actually very easy to make linking in Windows simple, Laurent just makes it complicated for library developers in favour of SFML beginners.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10818
    • View Profile
    • development blog
    • Email
Re: Other people can't run my programs...
« Reply #16 on: August 14, 2013, 05:23:38 pm »
So does dynamic linking make sense after all or you mean link everything statically? Or do you mean that everything is made dynamic and if they(SFG,SFML) match they use same one and if not they have they own each?
You can see the full discussion here. (and/or below or above)
I really hope Laurent can figure out a way to make it useful for both parties soon... :-\

Windows makes this really confusing. On linux everything works out of the box as dynamic and I've yet to have linking problem. Can't the same be done for Windows?(everything dynamic so if few dlls use certain lib they each use same dll instead of each linking in own lib).
Yes you could, if you'd start a packaging service as for all the distros, but it probably would never resolve itself, because all the existing applications would have to start using your package service, otherwise they'll still just be shipping their own DLL version etc.
The concept on Windows is really not that different from Linux's one (as far as I understand things), the issue is simply, that Windows didn't support different versions of DLLs in the past. It now somewhat does, but nobody really knows how. And this version issue led to the situation where we are now. Everyone ships their own version, to make sure that everything works.

There should be a linking tutorial or something, this gets really hellish on windows. What if I have exe and my engine dll or lib which both use SFML, SFG and Lua? Do I link all dynamically or statically to both? Lua when it was linked statically before I moved to Linux to write was causing problems in visual so I guess dynamically?
I usually go with the rule, either go static or dynamic. Starting to mix things is quite dangerous and with SFML even more, since this exactly where the issue comes into play. When linking statically you link the libraries all in the final application, so if library A is using SFML and exe B is using SFML, SFML will only be linked in exe B and library A will automatically be able to use it as well. What now SFML does when linking statically is, it includes GLEW into its static library, thus if you link against SFML and GLEW in your exe B, you'll end up with two different GLEW versions, which may or may not let the linker or compiler explode...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Other people can't run my programs...
« Reply #17 on: August 14, 2013, 05:52:36 pm »
Quote
Yes you could, if you'd start a packaging service as for all the distros, but it probably would never resolve itself,
I mean always dynamically, not make repos, since people are saying 'static linking makes no sense on windows' but there is LGPL and statically linking some things together explodes.

Quote
As I've said already, if you want to make money off your code, don't use GPL, that was not its purpose.
They actually say they promote earning money from software, which doesn't make sense for the most part since anyone can get it for free because of GPL rules so you can't earn unless you're selling support, services or copyright something that makes app not work(like assets for a game) almost at all.
« Last Edit: August 14, 2013, 05:58:00 pm by FRex »
Back to C++ gamedev with SFML in May 2023