c++ - 错误 C1083 无法打开包含文件 : 'pybind11/pybind11.h' : No such file or directory

标签 c++ cmake pybind11

我想从 Github 运行 T-spline,但每次尝试构建项目时都会出现此错误。 - 我将代码和其他所有内容放在 C:\Program Files (x86) 中。 -我使用 pybind/pybind11, -laumaya/GLC_lib 。 -我在 MSVC 中使用 Github 扩展,我直接通过扩展下载所有内容。 我为 T-spline 运行 CMake (3.13.1),看起来一切正常。我使用 MSVC 15 2017

谢谢

最佳答案

如果您使用的是 pybind11,则 you shouldn't do it this way .

首先让 pybind11 在你的 git 仓库中成为一个子模块,或者只是在你的源代码树中检查它并调用:

add_subdirectory(${CMAKE_SOURCE_DIR}/3rdParty/pybind11)

然后你可以创建一个pybind模块:

 pybind11_add_module(${NAME} MODULE ${SRC} ${HEADERS})

这样,如果缺少某些东西,您将在 CMake 启动时看到它,而不是在构建过程中。

关于c++ - 错误 C1083 无法打开包含文件 : 'pybind11/pybind11.h' : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53804175/

相关文章:

c++ - Windows 上 OpenCL 库的 0xc000007b 加载时错误

c++ - 带有 CMake 和嵌入式目标的 clang-tidy

c++ - Qt QSqlQuery 准备和 bindValue 不工作

c++ - 字符串 : Finding if the first word is repeated using strcmp

linux - 对 `pthread_create' CLion 的 undefined reference

python - pybind11 包装现有代码

c++ - 通过引用传递的特征参数

python - PyBind11:使用指向字符串的指针的构造函数

c++ - 编译时错误 "collect2: ld returned 1 exit status"

C++ 线程未加入 "Termination called without active exception"