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. angular 模板语法(官方文档摘录)

    https://angular.cn/guide/template-syntax {{}} 和"" 如果嵌套,{{}}里面求完值,""就是原意 <h3&g ...

  2. Codeforces 859C - Pie Rules

    859C - Pie Rules 思路: dp 我们知道无论谁拿到decider token他拿不拿蛋糕都是确定的,都是使自己最优的结果. 于是 定义状态:dp[i]表示到第i个位置拿到decider ...

  3. 20170708xlVBA添加新产品修改公式

    Sub ControlInsertProduct() Dim Wb As Workbook Dim OneSht As Worksheet Dim Arr As Variant Dim i As Lo ...

  4. bzoj 1267 Kth Number I (点分治,堆)

    超级钢琴的树上版本, 类似做法即可, 只不过区间转为dfs序了, 用点分求一下, 复杂度$O(nlog^2n)$ #include <iostream> #include <algo ...

  5. CentOS7.6 yum install Git

    1. yum install git 2. git version or git –version 3. uninstall:  git remove

  6. 原创-整理了下常用的js数组 、对象、数字、字符串的操作方法

    终于整理好了...主要是一些常用的函数,包含es6和es5的所有常用的,吧一些不常用的全部砍掉,省的大家看的费事.发现这个到博客上面有点乱.给个百度云地址:https://pan.baidu.com/ ...

  7. hdu2845_最大不连续子段和

    ---恢复内容开始--- Beans Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  8. log4j配置文件位置详解

    自动加载配置文件: (1)如果采用log4j输出日志,要对log4j加载配置文件的过程有所了解.log4j启动时,默认会寻找source folder下的log4j.xml配置文件,若没有,会寻找lo ...

  9. textBaseline

    <!DOCTYPE html><html><body> <canvas id="myCanvas" width="400&quo ...

  10. PHP header函数设置http报文头示例详解

    //定义编码 header( 'Content-Type:text/html;charset=utf-8 '); //Atom header('Content-type: application/at ...