跟配置opencv属性表-CSDN博客类似,新建一个ncnn的props,将以下内容写入即可完成配置,
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<!-- 请把NcnnRoot属性的值替换为你的ncnn编译输出的目标目录 -->
<NcnnRoot>D:\code\vs2017\ncnn_20240102\ncnn_20240102_no_openmp_no_avx2\</NcnnRoot>
<!-- 指定INCLUDE路径-->
<IncludePath>$(NcnnRoot)\include;$(IncludePath)</IncludePath>
<!-- 指定链接所需lib目录-->
<LibraryPath Condition="'$(Platform)'=='Win32'">$(NcnnRoot)\x86\vc15\lib\;$(LibraryPath)</LibraryPath>
<LibraryPath Condition="'$(Platform)'=='X64'">$(NcnnRoot)\x64\vc15\lib\;$(LibraryPath)</LibraryPath>
<LocalDebuggerWorkingDirectory>$(ProjectDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<!-- 以下是程序需要加载的lib文件。-->
<ItemDefinitionGroup>
<Link Condition="'$(Configuration)'=='Debug'">
<AdditionalDependencies>ncnnd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link Condition="'$(Configuration)'=='Release'">
<AdditionalDependencies>ncnn.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>