-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopencvpei-zhi-cckai-fa-huan-jing.html
executable file
·80 lines (67 loc) · 3.77 KB
/
opencvpei-zhi-cckai-fa-huan-jing.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>openCV配置c/c++开发环境</title>
<link rel="stylesheet" href="https://bridgeqiao.github.io/blog/theme/css/main.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="index" class="home">
<header id="banner" class="body">
<h1><a href="https://bridgeqiao.github.io/blog/">Bridge Qiao's Blog </a></h1>
<nav><ul>
<li class="active"><a href="https://bridgeqiao.github.io/blog/category/computer-vision.html">Computer vision</a></li>
<li><a href="https://bridgeqiao.github.io/blog/category/fun.html">fun</a></li>
<li><a href="https://bridgeqiao.github.io/blog/category/linux.html">linux</a></li>
<li><a href="https://bridgeqiao.github.io/blog/category/machine-learning.html">Machine Learning</a></li>
<li><a href="https://bridgeqiao.github.io/blog/category/matlab.html">Matlab</a></li>
<li><a href="https://bridgeqiao.github.io/blog/category/suan-fa-ti.html">算法题</a></li>
</ul>
</nav>
</header><!-- /#banner -->
<section id="content" class="body">
<article>
<header>
<h1 class="entry-title">
<a href="https://bridgeqiao.github.io/blog/opencvpei-zhi-cckai-fa-huan-jing.html" rel="bookmark"
title="Permalink to openCV配置c/c++开发环境">openCV配置c/c++开发环境</a></h1>
</header>
<div class="entry-content">
<footer class="post-info">
<span>五 10 八月 2018</span>
</footer><!-- /.post-info --> <p>由于开发openCV需要用到c++,所以配置了相应的环境。现在处于学习阶段,所以环境不是很重要,这里记录下在macos上的配置。</p>
<h3>安装openCV</h3>
<div class="highlight"><pre><span></span>brew install opencv
</pre></div>
<h3>安装vscode及其插件</h3>
<p>为了通用性,这里选用编辑器的方式,vscode直接在官网进行下载,插件包括c/c++、vscode-clangd、bracket pair colorized、xmake。</p>
<h3>安装xmake</h3>
<div class="highlight"><pre><span></span>brew install xmake pkg-config
</pre></div>
<p>xmake是构建工具,用起来比cmake舒服很多,pkg-config是用来提供编译指令的,在xmake.lua中,</p>
<p>加入下面两句。</p>
<div class="highlight"><pre><span></span><span class="n">add_cxflags</span><span class="p">(</span><span class="s2">"$(shell pkg-config opencv --cflags)"</span><span class="p">)</span>
<span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"$(shell pkg-config opencv --libs)"</span><span class="p">)</span>
</pre></div>
<h3>使用</h3>
<p>vscode加上xmake插件后,使用起来很舒服,最下面一排有很多按钮,可以直接点击编译、运行、调试。</p>
</div><!-- /.entry-content -->
</article>
</section>
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
<ul>
<li><a href="http://getpelican.com/">Pelican</a></li>
<li><a href="http://python.org/">Python.org</a></li>
<li><a href="https://github.com">Github</a></li>
</ul>
</div><!-- /.blogroll -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<p>Powered by <a href="http://getpelican.com/">Pelican</a>. Theme <a href="https://github.com/blueicefield/pelican-blueidea/">blueidea</a>, inspired by the default theme.</p>
</footer><!-- /#contentinfo -->
</body>
</html>