mynote/opencv/compile.md
2018-02-25 01:24:12 +08:00

19 lines
309 B
Markdown

# 编译opencv程序
## use g++
``` bash
g++ main.cpp `pkg-config opencv --cflags --libs`
```
## use cmake
> nano CMakeLists.txt
``` bash
cmake_minimum_required(VERSION 2.8)
project(test)
find_package(OpenCV REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main ${OpenCV_LIBS})
```