Description
Hi. Thanks a lot for this tutorial, I guess these might be noob issues, but I just feel like sharing how I could make this code work since it was not evident for me as a non-expert.
-
Set the Platform Toolset and SDK to fit my config (Visual Studio 2017 (v141) and 10.0.16299.0.)
-
Built CSharpLibrary, it was successful.
-
the build attempt of CSharpLibraryBridge gave the following error, which I ignored (since the CSharpLibraryBridge.lib, .dll and other files got created).
Error MSB3073 The command "powershell.exe -ExecutionPolicy Unrestricted -Command D:\CPlusPlusCLI-Tutorial-master\src\CSharpLibraryBridge\PostBuild.ps1 Release
:VCEnd" exited with code 1. CSharpLibraryBridge C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 133 -
In the program.cpp of the NativeCLibrary project, changed the include line for ExampleObj.h:
//#include <ExampleObj.h>
#include "../CSharpLibraryBridge/ExampleObj.h" -
Created a "lib" folder within the "src" folder and copied the generated "CSharpLibraryBridge.lib" file into it.
-
After these, the build and execution of NativeCLibrary were also successful.
Thanks again!