Ubuntu 使用OpenCV 利用Makefile运行

#CXXFLAGS += -c -Wall $(shell pkg-config --cflags opencv)
#LDFLAGS += $(shell pkg-config --libs --static opencv)

CXX = g++
CFLAGS     := -O3 -s -std=c++11

PLAT_LIB_DIR = /home/thunderwu/Tool/opencv3.4/opencv-3.4.0
INC     := -I$(PLAT_LIB_DIR)/include/
INC_LIB := -L$(PLAT_LIB_DIR)/release/lib
#LIB     :=-lopencv_core -lopencv_highgui -lopencv_imgproc -lpthread
LIB     := -lopencv_core -lopencv_imgproc -lopencv_video -lopencv_highgui -lopencv_calib3d -lopencv_features2d -lopencv_flann        -lopencv_imgcodecs -lopencv_videoio


OBJS = example.cpp
all: opencv_example

opencv_example: example.o; $(CXX) $(CFLAGS) $(INC) $< -o $@ $(INC_LIB) $(LIB)

%.o: %.cpp; $(CXX) $(CFLAGS) $(INC) -Wall -fPIC -c $^ -o $@

clean: ; rm -f example.o opencv_example

 

Ubuntu 使用OpenCV 利用Makefile运行

上一篇:Linux—tcpdump 命令详解(抓包命令)


下一篇:linux使用lvm分区