报错提示:
找不到serializer.h文件
或是其他cmake找不到文件
都可参考下面的方法
解决方法:
在发行版中,您可能会找到适用于 Windows 的预构建库,可用于任一集成方法。见 发布
CMake
可链接的目标是:
- depthai::core - 核心库,内部不使用 opencv
- depthai::opencv - Core + 支持 opencv 相关的辅助函数(需要 OpenCV4 )
使用 find_package
将 find_package
和 target_link_libraries
添加到您的项目中
find_package(depthai CONFIG REQUIRED)
...
target_link_libraries([my-app] PRIVATE depthai::opencv)
并将 CMake 指向目录:
-D'depthai_DIR=<path>/depthai-core-v{version}-win64/lib/cmake/depthai'
or
-D'depthai_DIR=<path>/usr/local/lib/cmake/depthai'
如果库安装到 Linux 上的默认搜索路径(即使用 deb 安装),则无需指定 depthai_DIR
,因为 CMake 会自动找到它。
非 CMake 集成(Visual Studio, Xcode, CodeBlocks, …)
在你的非CMake项目(新的Visual Studio项目,…)中
- 设置需要的库目录:
<path>/depthai-core-v{version}-win64/lib
(用于链接到depthai-core
或depthai-opencv
)<path>/depthai-core-v{version}-win64/bin
(用于.dll
的)
- And include directories
<path>/depthai-core-v{version}-win64/include
(library headers)<path>/depthai-core-v{version}-win64/include/depthai-shared/3rdparty
(shared 3rdparty headers)<path>/depthai-core-v{version}-win64/lib/cmake/depthai/dependencies/include
(dependency headers)
ℹ️ 线程库可能需要显式链接。
小技巧:遇到报错先在csdn内搜索,无法找到解决方法时可在我们群内提问!
其他常见报错:
请查看
OAK中国
| OpenCV AI Kit在中国区的官方代理商和技术服务商
| 追踪AI技术和产品新动态
戳「+关注」获取最新资讯↗↗