makefile for opencv
makefile
####################################################
# Generic makefile - 万能Makefile
# for compiling and linking C++ projects on Linux
# Author: George Foot Modified:Jackie Lee
####################################################
### Customising
#
# Adjust the following if necessary; EXECUTABLE is the target
# executable's filename, and LIBS is a list of libraries to link in
# (e.g. alleg, stdcx, iostr, etc). You can override these on make's
# command line of course, if you prefer to do it that way.
#
#
EXECUTABLE := main # 可执行文件名
LIBDIR:= /usr/local/lib/ # 静态库目录
#LIBS := opencv_core # 静态库文件名
LIBS := -lopencv_highgui -lopencv_core # 静态库文件名
INCLUDES:=/home/wang/Downloads/opencv-2.4./include , /home/wang/Downloads/opencv-2.4./include/opencv # 头文件目录
SRCDIR:= # 除了当前目录外,其他的源代码文件目录
#
# # Now alter any implicit rules' variables if you like, e.g.: CC:=g++
CFLAGS := -g -Wall -O3
CPPFLAGS := $(CFLAGS)
CPPFLAGS += $(addprefix -I,$(INCLUDES))
CPPFLAGS += -MMD
#
# # The next bit checks to see whether rm is in your djgpp bin
# # directory; if not it uses del instead, but this can cause (harmless)
# # `File not found' error messages. If you are not using DOS at all,
# # set the variable to something which will unquestioningly remove
# # files.
# RM-F := rm -f # # You shouldn't need to change anything below this point.
#
SRCS := $(wildcard *.cpp) $(wildcard $(addsuffix /*.cpp, $(SRCDIR)))
OBJS := $(patsubst %.cpp,%.o,$(SRCS))
DEPS := $(patsubst %.o,%.d,$(OBJS))
MISSING_DEPS := $(filter-out $(wildcard $(DEPS)),$(DEPS))
MISSING_DEPS_SOURCES := $(wildcard $(patsubst %.d,%.cpp,$(MISSING_DEPS))) .PHONY : all deps objs clean veryclean rebuild info all: $(EXECUTABLE) deps : $(DEPS) objs : $(OBJS) clean :
@$(RM-F) *.o
@$(RM-F) *.d
veryclean: clean
@$(RM-F) $(EXECUTABLE) rebuild: veryclean all
ifneq ($(MISSING_DEPS),)
$(MISSING_DEPS) :
@$(RM-F) $(patsubst %.d,%.o,$@)
endif
-include $(DEPS)
$(EXECUTABLE) : $(OBJS)
$(CC) -o $(EXECUTABLE) $(OBJS) $(addprefix -L,$(LIBDIR)) $(LIBS) #$(addprefix -l,$(LIBS)) info:
@echo $(SRCS)
@echo $(OBJS)
@echo $(DEPS)
@echo $(MISSING_DEPS)
@echo $(MISSING_DEPS_SOURCES)
cpp file
#include <cv.h>
#include <highgui.h>
using namespace std;
int main()
{
IplImage * test;
test = cvLoadImage("/home/wang/Desktop/1.png");//图片路径
cvNamedWindow("test_demo", );
cvShowImage("test_demo", test);
cvWaitKey();
cvDestroyWindow("test_demo");
cvReleaseImage(&test);
return ;
}
makefile for opencv的更多相关文章
- darknet+opencv在windows上的编译
darknet 源码网站:https://github.com/pjreddie/darknet 技术支持官网:https://pjreddie.com/darknet/ darknet采用C++编写 ...
- OpenCV使用CMake和MinGW的编译安装
官方教程:https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows 软件环境: Qt:5.11 CMake-3.14.4 OpenCV-4.1. ...
- OpenCV-3.4.2基于Qt-5.10.1的编译
OpenCV-3.4.2基于Qt-5.10.1的编译 由于本人在使用CMake和MinGW编译OpenCV是遇到了很多问题,在这里记录下来.至于所需软件的安装和相应环境变量的设置,网上有很多详细的教程 ...
- Ubuntn16.04安装opencv3.1(特别注意环境变量)
参考:http://lib.csdn.net/article/opencv/25737: http://blog.csdn.net/yiranyhy/article/details/72935499: ...
- opencv的CMakeLists.txt与makefile写法
opencv的CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(my_run_name) find_package(OpenCV R ...
- Ubuntu系统---编译opencv程序的几种方式g++、Makefile、Cmake
Ubuntu系统---编译opencv程序的几种方式g++.Makefile.Cmake 先建立一个工程(一个文件夹),写好xxx.cpp文件,可以是多个: //----------opencv.cp ...
- Makefile.am链接openCV库的写法
6 INCLUDES = `pkg-config opencv --cflags` -I./ 17 bin_PROGRAMS+=SegRecogServerDeme 18 SegRecogServer ...
- 一种调用opencv库的C++工程通用的Makefile模板
第一次自己写makefile,记录一下 #Compilers #CXX=/opt/compiler/gcc-/bin/g++ CXX = g++ #Includes INCLUDE_FLAGS = - ...
- makefile opencv的案例
CXX = g++ LIBS +=`pkg-config --libs opencv` INC +=`pkg-config --cflags opencv` CPPFLAGS += -g -std=c ...
随机推荐
- c++ 查找数组或者容器元素是否存在(find)
#include <iostream> // cout #include <algorithm> // find #include <vector> // vect ...
- Jmeter 中多线程并发和循环控制器
今天遇到一个场景, 给一个手机号发送短信验证码,通过正确输入短信验证码即登录并获得token,进行其他操作. 短信验证码是4位,即9999个组合, 接口没有对验证次数做校验,所以可以一直一直尝试通过验 ...
- MVC 子对象数据传递
1.接受参数 public ActionResult Address(User user) { return View(); } 2. User对象类型 public class User { pub ...
- 《剑指offer》第三十九题(数组中出现次数超过一半的数字)
// 面试题39:数组中出现次数超过一半的数字 // 题目:数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字.例 // 如输入一个长度为9的数组{1, 2, 3, 2, 2, 2, 5, ...
- smarty课程---smarty3的安装和使用
smarty课程---smarty3的安装和使用 一.总结 一句话总结:smarty 是什么,就不多说了,用过php,接触过php的人都对smarty 再熟悉不过了.它是一个很强大的代码分离软件,作为 ...
- java web mysql.jar java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 折腾了一上午,找到了这错误的原因.哎……悲剧! 确认包已经被导入web工程目录. 原来是 ...
- 4-12 如何搜索API
遇到一个参数prompt,使用rails ,API没有找到,怎么办? site关键字 在全网搜索 或者google一下,或是在stack overflow 上找答案 prompt 是FormOptio ...
- Confluence 6 从外部目录中同步数据手动同步缓存
你可以通过单击用户目录(User Directories)界面中的同步(Synchronize)按钮,手动进行同步.如果一个同步进程已经正在同步的过程中的话,你就不能在上一个同步进程完成之前重新进行同 ...
- 我的Java学习笔记-语法
Java的语法与C#的语法基本都一样,毕竟都是面向对象编程语言.下面记录下Java独有的和我在C#中学习不熟的语法知识 一.Java是解释型语言 二.Java修饰符 1. 访问控制修饰符 defaul ...
- git 添加tag
前言 什么是tag?tag是节点的意思,一般在上线的时候使用.比如说:你在本地做了好几个功能,然后把这些功能提交到了上线的分支上,某个时刻,你想上线你的新功能,这个时候你需要你个tag来标记一下,告诉 ...