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 ...
随机推荐
- sublime text3 (Mac) 快捷键
符号说明 符号 说明 ⌘ command ⌃ control ⌥ option ⇧ shift ↩ enter ⌫ delete 打开/关闭/前往 快捷键 功能 ⌘⇧N 打开一个新的sublime窗口 ...
- spring事务管理方式大全
http://blog.csdn.net/baibinboss/article/details/64922472
- C++STL1--set
C++STL1--set 一.说明 set的用法:单一元素,自动排序set的方法:用编译器的提示功能即可,不需要自己记 二.简单测试 /* 安迪的第一个字典 set的用法:单一元素,自动排序 set的 ...
- temp table
在Oracle8i或以上版本中,可以创建以下两种临时表: 1.会话特有的临时表 CREATE GLOBAL TEMPORARY <TABLE_NAME> ( <column spec ...
- Jmeter JDBC的使用
1.当我们在对接口进行断言或进行多个接口串联时,常常会需要从DB查询数据来做辅助,连接JDBC需要有支持DB的jar包:官网下载地址:https://dev.mysql.com/downloads/c ...
- python模块——re模块(简单的计算器功能实现_eval版)
#!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = "loki" # Usage: Make a Diy Calcu ...
- python-day33--Process类中的方法及属性
p.daemon = True -->守护进程,守护进程不可以再有子进程,并且主进程死守护进程就死,要写在p.start()之前 p.join() ---> 主进程等子进程执行完 之后再结 ...
- Oracle性能诊断艺术-读书笔记(范围分区)
1. PARTITION RANGE SINGLE 注意:操作2 中的 TABLE ACCESS FULL 并不是全表扫描,只是对分区1 做 全分区扫描 case2 2. 分区范围迭代(PARTITI ...
- oo第四篇博客作业
测试与正确性论证的效果差异及各自的优缺点: 测试针对一些典型的输入情况进行方法验证,可操作性更强,结果直观.但不能完全覆盖所有的输入情况. 正确性论证则是根据代码逻辑从所有的方面对方法进行论证,可操作 ...
- java连接MySql数据库 zeroDateTimeBehavior
JAVA连接MySQL数据库,在操作值为0的timestamp类型时不能正确的处理,而是默认抛出一个异常, 就是所见的:java.sql.SQLException: Cannot convert va ...