windows 10上源码编译dlib教程 | compile dlib on windows 10
2024-09-01 17:02:56
本文首发于个人博客https://kezunlin.me/post/654a6d04/,欢迎阅读!
compile dlib on windows 10
Series
Guide
compile
git clone https://github.com/davisking/dlib.git
cd dlib && mkdir build && cd build
cmake-gui ..
with options
CMAKE_INSTALL_PREFIX C:/Program Files/dlib
configure and compile with Visual Studio 2015
and install to C:/Program Files/dlib
.
By default,
dlib19.10.0_release_64bit_msvc1900.lib
will be generated.
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
# Every project needs a name. We call this the "examples" project.
project(examples)
# Tell cmake we will need dlib. This command will pull in dlib and compile it
# into your project. Note that you don't need to compile or install dlib. All
# cmake needs is the dlib source code folder and it will take care of everything.
add_subdirectory(../dlib dlib_build)
add_executable(demo demo.cpp)
target_link_libraries(demo dlib::dlib)
or
find_package(dlib REQUIRED)
if(MSVC)
set(dlib_LIBRARIES "C:/Program Files/dlib/lib/dlib.lib") # replace dlib::dlib
else()
endif(MSVC)
# ${dlib_INCLUDE_DIRS} and ${dlib_LIBRARIES} are deprecated, simply use target_link_libraries(your_app dlib::dlib)
MESSAGE( [Main] " dlib_INCLUDE_DIRS = ${dlib_INCLUDE_DIRS}")
MESSAGE( [Main] " dlib_LIBRARIES = ${dlib_LIBRARIES}")
add_executable(demo demo.cpp)
#target_link_libraries(demo ${dlib_LIBRARIES})
target_link_libraries(demo dlib::dlib)
dlib for python api
cd tools/python
mkdir build && cd build
cmake-gui ..
compile dlib_python
with Visual Studio 2015
and dlib.pyd
will be generated.
copy dlib.pyd
to C:\Python27\Lib\site-packages
.
test dlib for python
import dlib
dir(dlib)
Reference
History
- 20180330: created.
Copyright
- Post author: kezunlin
- Post link: https://kezunlin.me/post/654a6d04/
- Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.
最新文章
- 如何在 Java 中正确使用 wait, notify 和 notifyAll(转)
- 关于xcode导出设置中的一些概念
- jquery动态改变div宽度和高度
- android四大组件(简单总结)
- sqlserver 游标
- 如何使用C自带的qsort快速排序
- this.down和this.up用法
- PBcR - 纠错及组装算法
- who is the middle
- 138. Copy List with Random Pointer
- 优雅地使用CodeIgniter 3之Session类库(1)(转)
- SRM 394(1-250pt)
- Unix/Linux环境C编程入门教程(41) C语言库函数的文件操作详解
- Javascript自定义类
- Python集成开发环境(Eclipse+Pydev)
- [Linux] 一个前端必会的 Nginx 免费教程-在虚拟机中用deepin测试
- Python语言的PyCharm开发工具的简单使用
- 2018-2019-2 20175332-实验一《Java开发环境的熟悉》实验报告
- socket网络编程之不间断通信
- mongo java 踩坑记
热门文章
- C语言1作业004
- 玩转OneNET物联网平台之HTTP服务③ —— OneNet智能灯 HTTP版本
- 文件读取(filestream)
- django-个人网站之环境配置(一)
- C#开发命令执行驱动程序 之 控制标志的命令行参数
- 漏洞靶场--webug4.0安装
- idea 2019 1 spring boot 启动报错 An incompatible version [1.2.12] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14]
- C语言1博客作业04
- 【XSY2495】余数
- [Usaco 2012 Feb]Cow coupons牛券:反悔型贪心