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

Author Topic: Static release  (Read 6031 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Static release
« on: February 29, 2008, 06:04:38 pm »
In Visual C++ Express 2008, I am using SFML and linking statically with configuration "Release". Strangely, everything works if I link dynamically. I added the additional dependencies ("sfml-graphics.lib sfml-window.lib sfml-system.lib"), and order shouldn't be problem... I even tried to recompile the files in C:\...\SFML-1.2\vc2008\SFML.sln in release static mode and tested my project again, it didn't help.
I get a lot of errors like these:
Code: [Select]
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) is already defined in libcpmt.lib(string.obj).
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strncmp is already defined in LIBCMTD.lib(strncmp.obj).
(btw: output is translated, might be not literally)

Can you tell me why this occurs? I've read similar posts but I have seen nowhere the same problem.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Static release
« Reply #1 on: March 01, 2008, 04:53:28 am »
Which version of the C-RunTime are you linking with ?
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Static release
« Reply #2 on: March 01, 2008, 04:40:52 pm »
Hm.. Sorry I don't know the CRT version, where do I see it? I just installed Visual C++ 2008 Express Edition (Version is 9.0.21022.8 RTM).
Version of .NET Framework is 3.5, if this helps...

Which CRT version should it be (what is standard) to be able to link statically with SFML? Where can I get it?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Static release
« Reply #3 on: March 02, 2008, 05:36:14 am »
Project properties --> C / C++ --> Code generation --> Runtime library.

The value should be "Multithreaded debug DLL" in debug, and "Multithreaded DLL" in release.
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Static release
« Reply #4 on: March 02, 2008, 10:18:33 am »
With these settings it works (I've always set it like this).
But I think if I use the DLL configuration then I don't link statically any more... Am I wrong?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Static release
« Reply #5 on: March 02, 2008, 10:38:07 am »
This is just the settings used to link the CRT (the standard library), it has nothing to do with the SFML libraries.
Laurent Gomila - SFML developer