Use a C++ class from a Windows Phone Runtime Component project in another Windows Phone Runtime Component project. RRS feed

  • Question

  • Hello

    I have two projects which are Windows Phone Runtime Silverlight 8.1 Components using C++. I would like to use a class that is in one project ("Foo"), from the other ("Bar").

    In the project settings for the Bar project I have pointed to the correct include directory, and added an additional library directory to the folder containing Foo's .dll and .lib files. I have added Foo.lib as an additional dependency.

    Foo compiles OK, however Bar's compilation results in the following error:

    Error	1	error LNK2019: unresolved external symbol "public: __cdecl FooRuntimeComponent::FooClass::FooClass(void)" (??0FooClass@FooRuntimeComponent@@Q$AAA@XZ) referenced in function "public: __cdecl BarRuntimeComponent::BarClass::BarClass(void)" (??0BarClass@BarRuntimeComponent@@Q$AAA@XZ)

    When I run dumpbin on Foo.lib I get the following:

    Microsoft (R) COFF/PE Dumper Version 12.00.31101.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    Dump of file Foo.lib
    File Type: LIBRARY
              FF .debug$S
              14 .idata$2
              14 .idata$3
               4 .idata$4
               4 .idata$5
              20 .idata$6

    Any idea why Bar cannot see the symbols for Foo? Does it have anything to do with the metadata "Foo.winmd " file that is generated, and how that should be referenced?

    Any help appreciated.

    Wednesday, December 17, 2014 8:55 AM