locked
Using a dll built from a metro app?

    Question

  • Hey guys,

    I'm a noob when it comes to using dlls.  I have a C++/Direct3D metro app that I would like to export as a DLL for other (C++) projects to use.  After doing some reading for a while I am stumped on why my project still will not build. 

    1. I have configured the Direct3D metro app to build as a DLL and I have prefixed all of my classes in the project with __declspec(dllexport).  This builds fine and produces a dll.

    2. I add another project to the same solution and I add a reference to the existing DLL project.  I then configure the new application to include the header directory for the DLL project.  

    3. The new project is also a Direct3D metro app and I have included all of the necessary headers and libraries, the build error is related to unresolved externals from the DLL project. 

    Any help would be greatly appreciated, I have been stuck on this for a while.  

    Saturday, May 5, 2012 1:49 AM

Answers

  • Hello,

    You should include the lib file to the Direct3D metro app.
    Right Click your project->Properties->Configuration properties->Linker->Input-> Addition Dependencies, add the lib file name general with the DLL.

    Generally speaking, the lib name is the same with dll name +.lib.

    Best regards,
    Jesse


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

    • Marked as answer by mbradber Tuesday, May 8, 2012 1:15 AM
    Monday, May 7, 2012 11:21 AM