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

Author Topic: static link errors with SFML 1.6 / 2.0 RC and VS2005  (Read 6807 times)

0 Members and 1 Guest are viewing this topic.

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
static link errors with SFML 1.6 / 2.0 RC and VS2005
« on: September 29, 2012, 11:17:57 am »
Hi, I am trying use SFML in my screensaver ( http://www.moonscreensaver.com ) to make it cross platform.

I am stuck with a linking problem.
I can link ok dynamically ( /MD, /MDd ) but no luck with static link.

I have an include file to take care of the various imports and libs.
In the code, I have only one line for SFML where I create a sf::RenderWindow

// tests done under vs2005 with sfml 1.6

// the line below links OK both statically and dynamically
//sf::RenderWindow *App=NULL;

// the line below gives link errors if linked statically. Links OK with dynamic linking
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Hello World - SFML");
               
 

I also tried to exclude the standard conflicting libraries and I got more errors.
I tried all sorts of things (you can see the REMed lines.
I also recompiled from the source the library, but have the same problem.

Any help full ideas?
Thanks !!


This is the include file:
//
// use_sfml.h
//

#if !defined(USE_SFML_H)
#define USE_SFML_H

#pragma message("Compiling: " __FILE__ )
       

#if !defined(NDEBUG)   // debug

        #if defined(_DLL)
                //#define SFML_DYNAMIC
                //#undef SFML_STATIC

                #pragma message(__FILE__ ": Linking SFML dynamically/debug")

                #pragma comment(lib,"sfml-graphics-d.lib")
                //#pragma comment(lib,"sfml-audio-d.lib")
                //#pragma comment(lib,"sfml-network-d.lib")
                #pragma comment(lib,"sfml-window-d.lib")
                #pragma comment(lib,"sfml-system-d.lib")
                //#pragma comment(lib,"sfml-main-d.lib")

    #else
                //#define SFML_STATIC
                //#undef SFML_DYNAMIC
               
                #pragma message(__FILE__ ": Linking SFML statically/debug")

                #pragma comment(lib,"sfml-system-s-d.lib")
                #pragma comment(lib,"sfml-window-s-d.lib")
                #pragma comment(lib,"sfml-graphics-s-d.lib")
                //#pragma comment(lib,"sfml-audio-s-d.lib")
                //#pragma comment(lib,"sfml-network-s-d.lib")

                //#pragma comment(lib,"libcmtd.lib")
                //#pragma comment(lib,"LIBCPMTD.LIB")

                //#pragma comment(linker, "/nodefaultlib:libcmtd.lib")
                //#pragma comment(linker, "/nodefaultlib:libcpmtd.lib")
                //#pragma comment(linker, "/nodefaultlib:msvcrtd.lib")
                //#pragma comment(linker, "/nodefaultlib:msvcprtd.lib")

    #endif


#else // release compilation

        #if defined(_DLL)  // dynamic release
                //#define SFML_DYNAMIC
                //#undef  SFML_STATIC

                #pragma message(__FILE__ ": Linking SFML dynamically/release")
       
                #pragma comment(lib,"sfml-graphics.lib")
                #pragma comment(lib,"sfml-window.lib")
                #pragma comment(lib,"sfml-system.lib")

        #else // static release
                //#define SFML_STATIC
                //#undef  SFML_DYNAMIC
               

                #pragma message(__FILE__ ": Linking SFML statically/release")
                #pragma comment(lib,"sfml-system-s.lib")
                #pragma comment(lib,"sfml-graphics-s.lib")
                //#pragma comment(lib,"sfml-audio-s.lib")
                //#pragma comment(lib,"sfml-network-s.lib")
                #pragma comment(lib,"sfml-window-s.lib")
                //#pragma comment(lib,"sfml-main.lib")

                //#pragma comment(linker, "/nodefaultlib:libcmt.lib")
                //#pragma comment(linker, "/nodefaultlib:LIBCPMT.LIB")
 
                // If you build using /MD compiler option, your program will link with
                // http://support.microsoft.com/kb/154753
                #pragma comment(linker, "/nodefaultlib:msvcrt.lib")
                #pragma comment(linker, "/nodefaultlib:msvcprt.lib")
       
                //#pragma comment(linker, "/nodefaultlib:libc.lib")
               
    #endif


#endif


#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
//#include <SFML/Audio.hpp>
//#include <SFML/Network.hpp>


#endif // USE_SFML_H

 

and this is the output window:

------ Rebuild All started: Project: smScreensaver, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'smScreensaver', configuration 'Debug|Win32'
Compiling...
TmioanTime.cpp
TmioanTextFile.cpp
TmioanStrings.cpp
TmioanScreenWin.cpp
TmioanScreenSaverAbstract.cpp
Compiling: f:\work\c-proj\starmsg9\mioanlib\application\tmioanscreensaverabstract.h
Compiling: f:\work\c-proj\starmsg9\mioanlib\platform\use_sfml.h
f:\work\c-proj\starmsg9\mioanlib\platform\use_sfml.h: Linking SFML statically/debug
TmioanRandom.cpp
TmioanOperatingSystemWin.cpp
TmioanOperatingSystem.cpp
TmioanLogFileV2.cpp
TmioanLog.cpp
TmioanFileSystemWin.cpp
TmioanFileSystem.cpp
TmioanFilename.cpp
TmioanFile.cpp
TmioanErrorCollector.cpp
TmioanDateTime.cpp
starmsgScreensaver.cpp
Compiling: f:\work\c-proj\starmsg9\mioanlib\application\tmioanscreensaverabstract.h
Compiling: f:\work\c-proj\starmsg9\mioanlib\platform\use_sfml.h
f:\work\c-proj\starmsg9\mioanlib\platform\use_sfml.h: Linking SFML statically/debug
Generating Code...
Compiling resources...
Compiling manifest to resources...
Linking...
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in libcpmtd.lib(xlock.obj)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) already defined in libcpmtd.lib(stdthrow.obj)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::_Container_base::~_Container_base(void)" (??1_Container_base@std@@QAE@XZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::_Container_base::_Container_base(void)" (??0_Container_base@std@@QAE@XZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.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> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.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> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.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) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::_Container_base::_Orphan_all(void)const " (?_Orphan_all@_Container_base@std@@QBEXXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::substr(unsigned int,unsigned int)const " (?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV12@II@Z) already defined in TmioanFileSystem.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::find_last_of(char const *,unsigned int)const " (?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z) already defined in TmioanFileSystem.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(int)" (?width@ios_base@std@@QAEHH@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" (?eof@?$char_traits@D@std@@SAHXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBEHXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcpmtd.lib(uncaught.obj)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in starmsgScreensaver.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: void __thiscall std::_Container_base::_Swap_all(class std::_Container_base &)const " (?_Swap_all@_Container_base@std@@QBEXAAV12@@Z) already defined in TmioanOperatingSystem.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "bool __cdecl std::operator==<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 &,char const *)" (??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z) already defined in TmioanLogFileV2.obj
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in starmsgScreensaver.obj
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __CrtDbgReportW already defined in LIBCMTD.lib(dbgrptw.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: __thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fopen already defined in LIBCMTD.lib(fopen.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fwrite already defined in LIBCMTD.lib(fwrite.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fprintf already defined in LIBCMTD.lib(fprintf.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __gmtime64 already defined in LIBCMTD.lib(gmtime64.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fgetc already defined in LIBCMTD.lib(fgetc.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __wassert already defined in LIBCMTD.lib(wassert.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fseek already defined in LIBCMTD.lib(fseek.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _ftell already defined in LIBCMTD.lib(ftell.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _ldexp already defined in LIBCMTD.lib(ldexp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _getenv already defined in LIBCMTD.lib(getenv.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _memmove_s already defined in LIBCMTD.lib(memmove_s.obj)
   Creating library c:\tmp\StarMsgNew.lib and object c:\tmp\StarMsgNew.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
c:\tmp\StarMsgNew.scr : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://e:\Temp\smScreensaver-Debug\BuildLog.htm"
smScreensaver - 68 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

 
« Last Edit: October 03, 2012, 10:51:18 pm by starmessage »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10822
    • View Profile
    • development blog
    • Email
Re: static link errors with SFML 1.6 and VS2005
« Reply #1 on: September 29, 2012, 04:59:28 pm »
Don't use SFML 1.6, it's over 3 years old.
DON'T use #pragma comment to link stuff, specially since you're trying to get things cross platform. Linking settings have nothing to do with application code but are part of the project and thus should be put into the project file/nmake file/make file!!! >:(

Follow the tutorials and you should be fine.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
Re: static link errors with SFML 1.6 and VS2005
« Reply #2 on: September 29, 2012, 05:29:42 pm »
thanks for your reply.

I picked 1.6 because it is the last version that supports vs2005 and xcode 3.
I do not have macosx lion (neither like it) so I cannot use xcode 4.

Do you suggest that I must download version 2.0 and compile it myself to use it under vs2005 and under xcode 3?
I thought it is not compatible at least with xcode 3.
What are my SFML options for xcode 3?

To answer your other recommendations:

C++ is not my primary language. I come from the delphi world where all these linking is solved by the tool and you are never bothered with such issues.
So your suggestions for cmake/nmake are bit exotic to me.

I wouldn't agree with your objection for the #pragma comment to link libraries.
I find it very logical that each unit (if used) should bring in its own dependencies, and free the developer from going to other places in the tool to add paths and libraries.
This is only defined in the windows unit, so the cross platform is not a problem.

kind regards

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10822
    • View Profile
    • development blog
    • Email
Re: static link errors with SFML 1.6 and VS2005
« Reply #3 on: September 29, 2012, 10:41:48 pm »
I picked 1.6 because it is the last version that supports vs2005 and xcode 3.
It's supported but there are no precompiled binaries. Is there a specific reason why you can't swith to VS10 (the express version is free and should be more than enough)?

Do you suggest that I must download version 2.0 and compile it myself to use it under vs2005 and under xcode 3?
Yes I do!

I thought it is not compatible at least with xcode 3.
What are my SFML options for xcode 3?
When you recompile SFML on your own, I guess it should work, then again I've never worked with a Mac.

So your suggestions for cmake/nmake are bit exotic to me.
I've never suggested CMake, but well it would be the best solution. If you don't know it and plan on staying with C++ a bit longer you should definitely look into it!
Of course you can also just manually use the project files for VS + xcode for setting up the compiler and linker.

I wouldn't agree with your objection for the #pragma comment to link libraries.
You write that after you've stated:
C++ is not my primary language. I come from the delphi world where all these linking is solved by the tool and you are never bothered with such issues.
You can ask about any (good) C++ developer if it's good to use #pragma comment when writing crossplatform code and all of them will say NO!... ;)
Sure you can do what ever you want, but I'm not going to look through that 'config' file. :D

I find it very logical that each unit (if used) should bring in its own dependencies, and free the developer from going to other places in the tool to add paths and libraries.
Well if you speak in general terms, then you'd have to write 20+ different setup files to support all the major IDEs/compilers...
For that reason CMake and other tools where introduced which generate make or projects files for a big majority of IDEs/compilers from a small CMakeLists.txt file.
« Last Edit: September 29, 2012, 10:43:46 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
Re: static link errors with SFML 1.6 and VS2005
« Reply #4 on: October 03, 2012, 05:22:02 pm »
thanks for your answer. Following your advice I took the v2.0.

I am compiling on static/release mode.

I link with the libraries

sfml-graphics-s.lib
sfml-system-s.lib
sfml-window-s.lib

and I get the following linker errors:
msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcpmt.lib(uncaught.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in libcpmt.lib(locale0.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(void)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: bool __thiscall std::codecvt_base::always_noconv(void)const " (?always_noconv@codecvt_base@std@@QBE_NXZ) already defined in TmioanFile.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@QAEXXZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: static unsigned int __cdecl std::codecvt<char,char,int>::_Getcat(class std::locale::facet const * *,class std::locale const *)" (?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z) already defined in TmioanFile.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmt.lib(xlock.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in libcpmt.lib(xlock.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::getloc(void)const " (?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ) already defined in TmioanFile.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "struct _iobuf * __cdecl std::_Fiopen(char const *,int,int)" (?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z) already defined in libcpmt.lib(fiopen.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::codecvt<char,char,int>::in(int &,char const *,char const *,char const * &,char *,char *,char * &)const " (?in@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z) already defined in TmioanFile.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char *,char *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::codecvt<char,char,int>::unshift(int &,char *,char *,char * &)const " (?unshift@?$codecvt@DDH@std@@QBEHAAHPAD1AAPAD@Z) already defined in TmioanFile.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::codecvt<char,char,int>::out(int &,char const *,char const *,char const * &,char *,char *,char * &)const " (?out@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z) already defined in TmioanFile.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_istream<char,struct std::char_traits<char> >::~basic_istream<char,struct std::char_traits<char> >(void)" (??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::basic_istream<char,struct std::char_traits<char> >::basic_istream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z) already defined in starmsgScreensaver.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z) already defined in libcpmt.lib(ios.obj)
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::fpos<int> __thiscall std::basic_istream<char,struct std::char_traits<char> >::tellg(void)" (?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ) already defined in TmioanFileSystem.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::seekg(__int64,int)" (?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@_JH@Z) already defined in TmioanFileSystem.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z) already defined in TmioanFile.obj
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in starmsgScreensaver.obj
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMT.lib(memmove.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z) already defined in LIBCMT.lib(stdexcpt.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fgetc already defined in LIBCMT.lib(fgetc.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fputc already defined in LIBCMT.lib(fputc.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _ungetc already defined in LIBCMT.lib(ungetc.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: __lock_file already defined in LIBCMT.lib(_file.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: __unlock_file already defined in LIBCMT.lib(_file.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fflush already defined in LIBCMT.lib(fflush.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _setvbuf already defined in LIBCMT.lib(setvbuf.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memcpy_s already defined in LIBCMT.lib(memcpy_s.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fwrite already defined in LIBCMT.lib(fwrite.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fgetpos already defined in LIBCMT.lib(fgetpos.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: __fseeki64 already defined in LIBCMT.lib(fseeki64.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fsetpos already defined in LIBCMT.lib(fsetpos.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memchr already defined in LIBCMT.lib(memchr.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _ldexp already defined in LIBCMT.lib(_ldexp_.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fseek already defined in LIBCMT.lib(fseek.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _feof already defined in LIBCMT.lib(feoferr.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strtol already defined in LIBCMT.lib(strtol.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strncmp already defined in LIBCMT.lib(strncmp.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fopen already defined in LIBCMT.lib(fopen.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _ftell already defined in LIBCMT.lib(ftell.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _tolower already defined in LIBCMT.lib(tolower.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: ___iob_func already defined in LIBCMT.lib(_file.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
     Creating library c:\tmp\smScreensaver.lib and object c:\tmp\smScreensaver.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
c:\tmp\smScreensaver.scr : fatal error LNK1169: one or more multiply defined symbols found
 

Why is it linking against these dynamic libraries?
msvcrt.lib
msvcprt.lib

Then, I exclude these two libraries from the linker and the errors are reduced down to:

Link:
     Creating library c:\tmp\smScreensaver.lib and object c:\tmp\smScreensaver.exp
sfml-graphics-s.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class

std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct

std::char_traits<char> >::operator<<(unsigned int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z)
sfml-graphics-s.lib(GLCheck.cpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class

std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct

std::char_traits<char> >::operator<<(unsigned int)" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z)
sfml-graphics-s.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class

std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct

std::char_traits<char> >::read(char *,__int64)" (__imp_?read@?$basic_istream@DU?

$char_traits@D@std@@@std@@QAEAAV12@PAD_J@Z)
sfml-graphics-s.lib(ImageLoader.cpp.obj) : error LNK2001: unresolved external symbol __imp__fread
sfml-window-s.lib(WindowImpl.cpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public:

__thiscall std::_Container_base12::~_Container_base12(void)" (__imp_??1_Container_base12@std@@QAE@XZ)
c:\tmp\smScreensaver.scr : fatal error LNK1120: 4 unresolved externals

Build FAILED.
 

It seems to me like the -s libraries are actually dynamically linked. I have trippled checked my settings and they do have the /MT switch,


On the other hand, if I put as linked libraries the libraries without the -s

sfml-graphics.lib
sfml-system.lib
sfml-window.lib

it links Ok.
Then on runtime, it asks for the DLLs, but this is expected for the libraries without the -s.


Can you please help me understand why I cannot link with the static -s libraries?

thanks in advance !

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: static link errors with SFML 1.6 and VS2005
« Reply #5 on: October 03, 2012, 06:19:05 pm »
Did you change any option in CMake?
Laurent Gomila - SFML developer

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
Re: static link errors with SFML 1.6 and VS2005
« Reply #6 on: October 03, 2012, 08:49:00 pm »
I am not using CMAKE.
I tried to use it but after seeing that it can only generate a visual studio project from a cmakelist.txt and not the reverse, I prefered stay with the tools I already know.

It is a plain VC2010 project. Compiled with /MT.
Linked with the one or the other set of SFML libs.
I did not recompile SFML, I have downloaded the 2.0 candidate zip.

Maybe it is not common practive to link statically the executables with SFML? I am surprised how quicky I have ran into this problem.
« Last Edit: October 03, 2012, 08:50:40 pm by starmessage »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: static link errors with SFML 1.6 and VS2005
« Reply #7 on: October 03, 2012, 09:58:08 pm »
Quote
I did not recompile SFML, I have downloaded the 2.0 candidate zip
Ok, sorry. I thought you recompiled it.

Quote
It is a plain VC2010 project. Compiled with /MT.
You must use /MD, or recompile SFML with /MT.
Laurent Gomila - SFML developer

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
Re: static link errors with SFML 1.6 / 2.0 RC and VS2005
« Reply #8 on: October 05, 2012, 11:39:16 am »
I am recompiling SFML 2.0 RC93 and will let you know about the results.

For the precompiled libs you say 
Quote
You must use /MD


Can you please help me understand why?
I thought that the -s libs are ment to be compiled with /MT.
Were the distributed precompiled -s libs wrongly compiled/linked?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: static link errors with SFML 1.6 / 2.0 RC and VS2005
« Reply #9 on: October 05, 2012, 11:45:49 am »
Static SFML libraries don't use the static C runtime, this is a totally different thing. Both the static and dynamic versions of the SFML libraries link to the DLL C runtime (/MD).
Laurent Gomila - SFML developer

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
Re: static link errors with SFML 1.6 / 2.0 RC and VS2005
« Reply #10 on: October 05, 2012, 02:20:56 pm »
Dear  Laurent,

I think I understand now the concept of static/dynamic.

What you say, means that
- in all cases I must include in my screensaver installation the C runtime libs of visual studio.
- If I link to SFML with /MD, then I need to also discribute the SFML DLLs, while,
   if I link to SFML with /MT, then I do not need to distribute the SFML DLLs

Did I understand this correctly?

By the way, I looked at may cross platform libraries
( All of these:  http://www.24hsoftware.com/DevelopersForum/CrossPlatform-C-Library.html)
and find that SFML is the most compact and promising one.

thanks

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: static link errors with SFML 1.6 / 2.0 RC and VS2005
« Reply #11 on: October 05, 2012, 06:02:37 pm »
Quote
- If I link to SFML with /MD, then I need to also discribute the SFML DLLs, while,
   if I link to SFML with /MT, then I do not need to distribute the SFML DLLs
No. /MD and /MT control how you link the C runtime. Choosing the static or dynamic version of SFML is a different thing, which is explained in the tutorials.
Laurent Gomila - SFML developer

starmessage

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • View the moon phase and write your name in the stars
Re: static link errors with SFML 1.6 / 2.0 RC and VS2005
« Reply #12 on: October 17, 2012, 09:52:19 am »
Finally, I adandoned my ambition to compile with /MT and am compiling with /MD.
Everything looks Ok.
thanks for your help.

 

anything