SFML community forums

Help => General => Topic started by: kennyrkun on May 26, 2018, 07:24:15 am

Title: static GUI library statically linking SFML
Post by: kennyrkun on May 26, 2018, 07:24:15 am
I'm writing a basic GUI system using SFML. It links SFML statically into it, and the lib itself is meant to be statically linked. Apparently this is bad, but I'm not sure how.

LNK4006 _vorbis_encode_init already defined in vorbisenc.lib(vorbisenc.obj); second definition ignored  SFUI    P:\aRepositories\SFUI\SFUI\vorbis.lib(vorbisenc.obj)

I am still able to link this library into main applications, and it works fine. But I don't like these warnings and I'd like to know if there's anything I can do to get rid of them, of there's a proper way to do what I'm wanting to do. The idea is that the main application ships with no extra dlls or installers.

 ;)
Title: Re: static GUI library statically linking SFML
Post by: eXpl0it3r on May 26, 2018, 09:09:04 am
What's your verbose build command? Sounds to me you're double linking stuff.

https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide
Title: Re: static GUI library statically linking SFML
Post by: kennyrkun on May 27, 2018, 01:08:39 am
here's Visual Studio's verbose build output (https://pastebin.com/mp9eMN7x)
Title: Re: static GUI library statically linking SFML
Post by: eXpl0it3r on May 27, 2018, 11:50:26 am
Did you raise the warning levels? Never seen these warnings otherwise. I mean there are even some warnings for system libs. In the end those are just warnings that can be ignored.
Title: Re: static GUI library statically linking SFML
Post by: kennyrkun on May 27, 2018, 10:27:24 pm
Yes, I use W4 level for my release builds.
Title: Re: static GUI library statically linking SFML
Post by: dabbertorres on May 29, 2018, 11:21:52 pm
If SFML is statically linked to its dependencies, then your SFUI library shouldn't need to link in SFML's dependencies.

(I'm looking at line 114 of your pastebin - your SFUI lib is linking SFML static libs AND its dependencies)