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 ...
随机推荐
- Qt5.3.2_Oracle驱动
参考网址:http://blog.csdn.net/sdqyhn/article/details/39855847 ZC: 将编译好的 qsqloci.dll和qsqlocid.dll 放到 目录“E ...
- spring boot 邮件发送(带附件)
首先开启QQ邮箱的POP.SMTP服务器,获取授权码. 设置-->账户-->POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务 pom.xml需要加载三个ja ...
- 禁用表单元素 && 禁止选中
一.禁用表单元素 1.dom设置属性 disabled="disabled" || disabled=true 2.css样式(高版本浏览器) pointer-events:non ...
- Python 爬虫-Requests库入门
2017-07-25 10:38:30 response = requests.get(url, params=None, **kwargs) url : 拟获取页面的url链接∙ params : ...
- Dalvik VM (DVM) 与Java VM (JVM) 的区别?
Dalvik虚拟机存在于Android系统,JVM是java虚拟机,两者都是虚拟机,本文就对两者进行比较,讲述它们的不同. Dalvik虚拟机是Google等厂商合作开发的Android移动设备平台的 ...
- 雷林鹏分享:C# 匿名方法
C# 匿名方法 我们已经提到过,委托是用于引用与其具有相同标签的方法.换句话说,您可以使用委托对象调用可由委托引用的方法. 匿名方法(Anonymous methods) 提供了一种传递代码块作为委托 ...
- [Java学习] Java多态和动态绑定
在Java中,父类的变量可以引用父类的实例,也可以引用子类的实例. 请读者先看一段代码: 1. public class Demo { 2. public static void main(Strin ...
- CentOS7 install apache
1. yum install httpd 2. config /etc/httpd/conf/httpd.conf <VirtualHost *:80> ServerName www.l ...
- hdu3294 manacher
One day, sailormoon girls are so delighted that they intend to research about palindromic strings. O ...
- ccf行车路线
#include<bits/stdc++.h> using namespace std; const long long INF = 1e18; int n,m; struct node{ ...