每次創(chuàng)建QT項(xiàng)目都需要去添加include目錄,很麻煩,解決方法如下:
1.找到VS安裝目錄下的Microsoft.Cpp.MSVC.Toolset.Common.props文件
…\Microsoft Visual Studio Enterprise\2022\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.MSVC.Toolset.Common.props文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-618360.html
2.搜索$(IncludePath)定位到文件內(nèi)容
<IncludePath Condition="'$(IncludePath)' == ''">
$(VC_IncludePath);$(WindowsSDK_IncludePath);
</IncludePath>
3.修改IncludePath,添加自己的include進(jìn)去
<IncludePath Condition="'$(IncludePath)' == ''">
$(VC_IncludePath);
$(WindowsSDK_IncludePath);
....\Qt5_12_8\5.12.8\msvc2017_64\include;
</IncludePath>
注:這里為了顯示美觀,加上了換行,在修改時(shí),原本是啥就直接加上去就好,不然可能會(huì)報(bào)fatal error RC1015: cannot open include file ‘winres.h‘這種莫名其妙的錯(cuò)誤文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-618360.html
到了這里,關(guān)于VS2022永久添加IncludePath的方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!