locked
Windows Store DLL lib file missing

    Question

  • I have a solution containing an application and a DLL. The DLL is instantiated from the c++ DLL (Windows Store apps) template. After creation and adding some classes, I added the DLL as reference to the application, as described on the DLL msdn page.

    Everything looks fine till I am trying to link my app to the DLL. The compiler then complains about:

    Error 1 error LNK1181: cannot open input file '<private dir>\win8\Debug\DiceLib\DiceLib.lib' <private dir>\win8\DiceEditor\LINK DiceEditor

    I searched through the whole folder structure of my project, but allas no lib file. I hava also looked at the compile options, but I noticed that there was already a statement like:

    /IMPLIB:"<private dir>\win8\Debug\DiceLib\DiceLib.lib"

    So, I have 2 questions:

    1) how to get a lib file so I can link my app to this dll

    2) why is the "Generate windows metadata" propery by default No for a DLL project? Isn't this used for ref classes? (if not, what is the use then?)

    Thanks for your time.

    Jeroen

    Monday, November 26, 2012 8:02 AM

Answers

  • Yesterday I learned the difference between the DLL and Windows Runtime Component DLL.

    In a DLL, you actually need to export classes as in the old win32 style with _declspec(ddlexport) in order to get the Lib file generated (not sure if this works for ref classes as well). This was not entirely clear for me. In the case of a Windows Runtime Component, you don't have to export explicitly. There all public ref classes that are sealed are exported implicitly.

    I am not using this Windows Runtime Component project type, although it does have it shortcomings like the inability of public inherited classes. There are ways around these weaknesses, which makes the component easier to use. Just add a reference to the project using that component and it is working. Great!

    Only thing that currently remains unclear is what this meta data property exactly does.

    • Marked as answer by Jesse Jiang Wednesday, December 05, 2012 2:34 AM
    Tuesday, November 27, 2012 12:33 PM
  • Hi,

    As far as I know, if we set the /WINMD (Generate Windows Metadata) settings. The output file is xxx.winmd file.

    The .Winmd file can be referenced into your project directly.

    Bust the Winmd file need some reference like platfom.winmd or Windows.winmd.

    http://msdn.microsoft.com/en-us/library/jj157268.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us


    • Edited by Jesse Jiang Wednesday, November 28, 2012 4:38 AM
    • Marked as answer by Jesse Jiang Wednesday, December 05, 2012 2:34 AM
    Wednesday, November 28, 2012 4:36 AM

All replies

  • Yesterday I learned the difference between the DLL and Windows Runtime Component DLL.

    In a DLL, you actually need to export classes as in the old win32 style with _declspec(ddlexport) in order to get the Lib file generated (not sure if this works for ref classes as well). This was not entirely clear for me. In the case of a Windows Runtime Component, you don't have to export explicitly. There all public ref classes that are sealed are exported implicitly.

    I am not using this Windows Runtime Component project type, although it does have it shortcomings like the inability of public inherited classes. There are ways around these weaknesses, which makes the component easier to use. Just add a reference to the project using that component and it is working. Great!

    Only thing that currently remains unclear is what this meta data property exactly does.

    • Marked as answer by Jesse Jiang Wednesday, December 05, 2012 2:34 AM
    Tuesday, November 27, 2012 12:33 PM
  • Hi,

    As far as I know, if we set the /WINMD (Generate Windows Metadata) settings. The output file is xxx.winmd file.

    The .Winmd file can be referenced into your project directly.

    Bust the Winmd file need some reference like platfom.winmd or Windows.winmd.

    http://msdn.microsoft.com/en-us/library/jj157268.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us


    • Edited by Jesse Jiang Wednesday, November 28, 2012 4:38 AM
    • Marked as answer by Jesse Jiang Wednesday, December 05, 2012 2:34 AM
    Wednesday, November 28, 2012 4:36 AM