vcpkg安装wxWidgts但出现包含错误

时间:2020-05-11 22:58:33

标签: c++ visual-studio-code wxwidgets vcpkg

正如标题所述,我使用vcpkg安装wxWidgets。然后,我运行./vcpkg集成安装,并说应用了用户范围的集成。 wxWidgets文档说我现在应该可以在项目中使用wxWidget标头,但是VSC仍然给我这个错误:

#include <wx/wxprec.h>
// error = #include errors detected. Please update your includePath.

我检查了我的includePath中的Visual Studio代码,并且有两条路径

"${workspaceFolder}/**",
"${vcpkgRoot}/x64-osx/include"

有什么想法吗?

我尝试添加这些路径

/Users/ryne/vcpkg/packages/wxwidgets_x64-osx/include/wx-3.1 

/Users/ryne/vcpkg/installed/x64-osx/include

但是没用

1 个答案:

答案 0 :(得分:0)

转到您的 vcpkg 文件夹并输入 vcpkg integrate install,它会在您安装任何软件包时自动添加到您的 Visual Studio 的路径和链接。

注意:您应该使用管理权限运行命令