当我尝试在vscode中使用#include <box2d/box2d.h>时。我得到了这个错误:
fatal error: box2d/box2d.h: No such file or directory
#include <box2d/box2d.h>当我包含库时,甚至vscode也会自动完成它
我的vcpkg列表./vcpkg list
box2d:x64-linux 2019-12-31 An open source C++ engine for simulating rigid b...
我还创建了集成步骤./vcpkg integrate install
输出:
Applied user-wide integration for this vcpkg root.
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/home/mohamed/packman/scripts/buildsystems/vcpkg.cmake"在安装库时,我是否遗漏了一个步骤
发布于 2020-11-19 02:26:44
在安装vcpkg install box2d包时,您应该有CMake targets说明。例如,我有这样的例子:
The package box2d:x64-linux provides CMake targets:
find_package(unofficial-box2d CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::box2d::box2d)然后,您需要使用这些指令更新您的CMakeLists.txt,并最终将main替换为目标的名称。
https://stackoverflow.com/questions/61814717
复制相似问题