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的更多相关文章

  1. darknet+opencv在windows上的编译

    darknet 源码网站:https://github.com/pjreddie/darknet 技术支持官网:https://pjreddie.com/darknet/ darknet采用C++编写 ...

  2. 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. ...

  3. OpenCV-3.4.2基于Qt-5.10.1的编译

    OpenCV-3.4.2基于Qt-5.10.1的编译 由于本人在使用CMake和MinGW编译OpenCV是遇到了很多问题,在这里记录下来.至于所需软件的安装和相应环境变量的设置,网上有很多详细的教程 ...

  4. Ubuntn16.04安装opencv3.1(特别注意环境变量)

    参考:http://lib.csdn.net/article/opencv/25737: http://blog.csdn.net/yiranyhy/article/details/72935499: ...

  5. opencv的CMakeLists.txt与makefile写法

    opencv的CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(my_run_name) find_package(OpenCV R ...

  6. Ubuntu系统---编译opencv程序的几种方式g++、Makefile、Cmake

    Ubuntu系统---编译opencv程序的几种方式g++.Makefile.Cmake 先建立一个工程(一个文件夹),写好xxx.cpp文件,可以是多个: //----------opencv.cp ...

  7. Makefile.am链接openCV库的写法

    6 INCLUDES = `pkg-config opencv --cflags` -I./ 17 bin_PROGRAMS+=SegRecogServerDeme 18 SegRecogServer ...

  8. 一种调用opencv库的C++工程通用的Makefile模板

    第一次自己写makefile,记录一下 #Compilers #CXX=/opt/compiler/gcc-/bin/g++ CXX = g++ #Includes INCLUDE_FLAGS = - ...

  9. makefile opencv的案例

    CXX = g++ LIBS +=`pkg-config --libs opencv` INC +=`pkg-config --cflags opencv` CPPFLAGS += -g -std=c ...

随机推荐

  1. Java Selenium 笔记

    目录一.基本语句 1.循环控制(break,continue) 3.字符的替换(replace,repalceFirst,replaceAll,regex) 4.字符串的连接("+" ...

  2. 如何 Graphics 对象设置背景色

    用 Clear 方法可以轻松地给 Graphics 对象设置背景色. using (Bitmap bmp = new Bitmap(width, height)){    using (Graphic ...

  3. Spring AOP之使用注解创建切面

    上节中我们已经定义了Performance接口,他是切面中的切点的一个目标对象.那么现在就让我们使用AspectJ注解来定义切面吧. 1.定义切面 下面我们就来定义一场舞台剧中观众的切面类Audien ...

  4. grub 启动错误 "file not found"

    刚安装ubuntu 14.4 竟然出现这么尴尬的事,ubuntu 行不行? 幸好还是能从u盘启动后,转到硬盘. 然后在网上找到了解决方法. http://askubuntu.com/questions ...

  5. Confluence 6 LDAP 成员结构设置

    用户组成员属性(Group Members Attribute) 这个属性字段将在载入用户组成员的时候使用.例如: member 用户成员属性(User Membership Attribute) 这 ...

  6. java plsql 调用oracle数组类型

    首先当然是在oracle中建立type CREATE OR REPLACE TYPE cux_proxy_bid_award_rec IS OBJECT ( trading_partner_id NU ...

  7. OAF 清空指定控件或区域的值

    CO if (pageContext.getParameter("ClearBtn") != null) { clearRegion(pageContext, webBean, & ...

  8. SQL调优(SQL TUNING)之远程支持完成性能大幅优化

    前几天,一个朋友找到我,说一个SQL性能有问题,看看能不能优化,下面为过程: 雪豹 9:35:10 在吗 兰花岛主 15:07:39 忙忘了,有事儿? 雪豹 15:07:49 嗯 雪豹 15:07:5 ...

  9. 《程序员面试金典》习题解答(C/C++)

    一.数据结构 1.数组与字符串 1.1  实现一个算法,确定一个字符串的所有字符是否全都不同.假使不允许使用额外的数据结构,又该如何处理? /* 假设字符集为ASCII字符串,那么字符串至多有256个 ...

  10. java并发编程:线程安全管理类--原子操作类--AtomicStampedReference<V>

    1.类 AtomicStampedReference<V> AtomicStampedReference 维护带有整数“标志”的对象引用,可以用原子方式对其进行更新. 实现注意事项.通过创 ...