I am getting the following error:
fatal error C1107: could not find assembly 'platform.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable
Steps to reproduce
0) Create a new empty project
1) C/C++ > General > Consume Windows Runtime Extension > YES
2) C/C++ > Code Generation > Enable Minimal Rebuild > No
3) Add a source file *.cpp, file can be blank
4) Attempt to compile
I tried to manually compare and change the project settings to match that in some sample code but nothing seems to work.
I don't understand what the problem you have, so
To create a C++/CX Desktop application:
In C/C++ -> General
project properties, set Consume Windows Runtime Extension
to Yes
In the same tab enter these to your Additional #using Directories
enter the directories containing the windows.winmd
and platform.winmd
files. For me, with VS2017, that is:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\store\references;
C:\Program Files (x86)\Windows Kits\10\UnionMetadata;
C:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract\2.0.0.0;
C:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.FoundationContract\2.0.0.0
Then call RoInitialize or use a WinRT main style function (to remove the warning C4447 about main threading):
using namespace Platform;
int main(Array<String^>^ args) ....
References:
Using C++/CX in Desktop apps,
Calling Windows 10 APIs from a desktop application
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With