Visual Studio 2008 issues

If you’re building a text service DLL, you almost certainly don’t want to use Visual Studio 2008’s compiler.  The problem is that Visual Studio 2008 uses a new C Runtime Library, and if you build your text service with Visual Studio, your text service likely won’t load in all applications.  (Plus, you would have to redistribute the C Runtime Library.)

What to do instead?

Well, I would recommend installing the Vista (or XP) DDK and use the DDKWizard instead.  The DDK comes with its own C/C++ compiler that uses the C Runtime Library that ships with the OS (and won’t cause problems with other applications), and the DDKWizard will let you use all of Visual Studio’s awesome capabilities.

Comments (5)

  1. CS says:

    Hi Eric,

    CRT dll problem have been existed for long time infamously known as DLL hell problem. So I always prefer statically link CRT library. I’m a bit surprised you recommend DDK with a OSR tool because of this issue.

  2. Steven says:

    Interesting tip.

    Do license restrictions apply to the distribution of native end-user applications complied/built with the C/C++ compiler which ships with the DDK?

  3. Eric C Brown says:

    Steven – I believe that the DDK has a license agreement that describes the redistribution rights.

    That being said, however, if you link against the CRT dll that ships with the OS – and do not redistribute the dll – you should be fine.

    I am NOT a lawyer and this is NOT legal advice.

  4. Eric C Brown says:

    CS – statically linking the CRT library doesn’t necessarily solve the problem of multiple runtimes, and may actually make things worse.  You have Thread-Local Storage issues, multiple heap issues, and so forth.

  5. CS says:

    Eric, then what if I want to distribute text service DLL to different versions of OS (XP, Vista and etc)? Should I prepare different binaries for different OS? Again from my understanding, this is not a TSF specific issue. Please correct me if I’m wrong.

    And the problems of statically linking CRT library you mentioned seems not big issues to me. (I don’t know what do you mean by TLS issues though. Can you tell me a little more detail?) Thanks.