linker does not generate resource-only DLL-Collection of common programming errors


  • msdn Hi there,I’m new on DLLs, but I want to use resource-only DLLs to support different languages in my application.So I created a new empty DLL project in VC++ (2008 Express SP1), and addes my 2 files:1) Resource.h, which looks like this:

    #define IDS_SOMESTRING1 40000

    #define IDS_SOMESTRING2 40001

    and 2) MyLang.rc, which looks like this:

    #include “Resource.h”#include LANGUAGE LANG_GERMAN, SUBLANG_DEFAULTSTRINGTABLEBEGIN    IDS_SOMESTRING1 “Sample text”    IDS_SOMESTRING2 “Hellp World”

    END

    In the project settings -> linker options I set the entry point to none (/NOENTRY). All other settings are left default.Now when I build the project, the .res file is generated, but not the .dll file. There is no error reported by the resource builder or linker.But when I manually do a “link /dll /machine:x86 /noentry /out:MyLang.dll MyLang.res”, it works and the DLL will be generated.Anyone knows or has a hint why VC++ will not generate the resource-only DLL?


  • msdn1 Oops…I looked for the DLL in the wrong directory.Indeed the linker works correctly and puts the DLL into \, but of course not into \ where I searched for it.I guess I need some vacation soon…

  • msdn2 Thanks for the quick answer, but my application is pure Win32 API (not even MFC) and must not depend on the .NET framework for several reasons.The DLLs are intended to minimize the executables size. The user may change the language inside the app. Therefore the appropriate language DLL wil be loaded, and the program code itself stays the same.

  • msdn3

    I am really wondering how its related to MFC.Yes, if you are having the bunch of dll’s created using the suggested / anyother approach then its at runtime your app/regional settings would dynamically load the dll’s.In my view it should not matter if its Win32 API OR MFC the approach would be same anyways Good luck for localizing your app.


  • msdn4 Well, I can’t use winres, resgen and al, because they are all tools that:a) create or are based of CLR, assemblies and the .NET framework, which I don’t useb) are not included in VS express edition anywaysThe simple question is, why VC++ 2008 Express SP1 does not link successfully a resource-only DLL (although claiming to do so), while the command-line based use of link.exe with the same parameters does.

  • msdn5 Oops…I looked for the DLL in the wrong directory.Indeed the linker works correctly and puts the DLL into \, but of course not into \ where I searched for it.I guess I need some vacation soon…