Statically linking on windows causes errors

Help
2006-08-25
2013-02-09
  • Xo Wang (GHF)
    Xo Wang (GHF)
    2006-08-25

    I've been coding around your library, and I'll say that it's wonderfully useful and portable. However, on windows, I can only build it by linking the the dynamic libraries. If I link to the static lib, whether it's the one in libircclient-win32-vc-1.1.zip or one I compiled myself, I get error 2, or "Host not resolved." I've also tried simply adding libircclient.c as a source file, and linking with WSock32.lib. The spammer and irctest examples don't work with static libs either, so it's not my code that's the problem. It never works if I link with the static libs, but works perfectly if I link with the dynamic library.
    I am building on WinXP Pro SP2, using Visual Studio .NET 2003 and Visual Studio 2005. I don't really care that dynamic libs are slower, but it's just annoying to have to package a DLL with the app if I were to release something.

     
    • George Yunaev
      George Yunaev
      2006-08-29

      When you link to static lib, you must do winsock initialization yourself before calling any libircclient functions. This is mentioned in FAQ.

       
    • Xo Wang (GHF)
      Xo Wang (GHF)
      2006-09-02

      where are the FAQs?

       
      • Xo Wang (GHF)
        Xo Wang (GHF)
        2006-09-02

        oh, oops...never mind...it's in related pages

         
      • George Yunaev
        George Yunaev
        2006-09-02

        In dochtml package.