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

Author Topic: SFML run-time libraries  (Read 3087 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
SFML run-time libraries
« on: October 21, 2011, 04:46:00 pm »
Hi (Laurent!)

I have been chasing mem leaks in my program, and in doing so I want to fix this message I get when compiling my app:

defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library

This is caused by having different run-time library types in one or more parts of my program (http://msdn.microsoft.com/en-us/library/Aa267384).
I checked all libraries in use, and they all compile with /MTd for a debug build, and /MT for release.

When you follow those instructions on that MSDN page, you get this:

Code: [Select]
1>sfml-audio-s-d.lib(AudioDevice.obj) : error LNK2001: unresolved external symbol ___security_cookie
1>libcpmtd.lib(syserror.obj) : error LNK2001: unresolved external symbol ___security_cookie
1>libcpmtd.lib(locale0.obj) : error LNK2019: unresolved external symbol ___security_cookie referenced in function __ehhandler$?_Facet_Register@facet@locale@std@@CAXPAV123@@Z
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol ___security_cookie
1>sfml-audio-s-d.lib(SoundBuffer.obj) : error LNK2001: unresolved external symbol ___security_cookie
1>sfml-audio-s-d.lib(SoundSource.obj) : error LNK2001: unresolved external symbol ___security_cookie


For every object file in every SFML library.

Any ideas??
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML run-time libraries
« Reply #1 on: October 21, 2011, 04:55:35 pm »
No, no idea. But I remember doing it some time ago for CSFML, and as far as I remember it worked.
Laurent Gomila - SFML developer

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
SFML run-time libraries
« Reply #2 on: October 25, 2011, 04:16:02 am »
You shouldn't have to touch the /MTd and /MT.
Just go in the property > Linker > Input > Ignore All Defaults Library->Yes(/NODEFAULTLIB)
Should fix it.
GitHub
Code Concept
Twitter
Rosme on IRC/Discord

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
SFML run-time libraries
« Reply #3 on: October 25, 2011, 09:57:30 am »
Quote from: "Rosme"
You shouldn't have to touch the /MTd and /MT.
Just go in the property > Linker > Input > Ignore All Defaults Library->Yes(/NODEFAULTLIB)
Should fix it.


I tried that first thing, and I get these linker errors, and a lot more besides:

Code: [Select]

1>sfml-system-s.lib(Err.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ)
1>sfml-window-s.lib(VideoModeImpl.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ)
1>sfml-window-s.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ)
1>sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ)
1>sfml-graphics-s.lib(ImageLoader.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ)
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML run-time libraries
« Reply #4 on: October 25, 2011, 01:38:36 pm »
Quote
Just go in the property > Linker > Input > Ignore All Defaults Library->Yes(/NODEFAULTLIB)

That can't work, you need at least one standard library.
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
SFML run-time libraries
« Reply #5 on: October 25, 2011, 03:56:50 pm »
Is the root cause of this the OpenAL audio stuff, or another library that SFML uses? What run-time library were they compiled with?
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML run-time libraries
« Reply #6 on: October 25, 2011, 03:59:46 pm »
It depends which version of SFML we're talking about.
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
SFML run-time libraries
« Reply #7 on: October 25, 2011, 04:19:22 pm »
SFML2, latest version :)
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML run-time libraries
« Reply #8 on: October 25, 2011, 04:29:07 pm »
If I remember correctly, dependencies were compiled with /MT.
Laurent Gomila - SFML developer

 

anything