非QT 等界面形式进行大华SDK的调用,主要就是解决Linux下调用大华SDK的一个环境搭建问题。
Makefile 文件
TARGET=netSdkDEMO
CC=gcc
CXX=g++
CFLAGS=-g
CPPFLAGS=-DLINUX
INCLUDE=-I.
LIBS=-L. -ldhnetsdk -ldhconfigsdk -lpthread
include Makefile.mk
Makefile.mk文件
CPP_SOURCES=$(wildcard *.cpp)
CPP_OBJECTS = $(patsubst %.cpp, %.o, $(CPP_SOURCES))
CPP_DEPENDS = $(patsubst %.cpp, %.d, $(CPP_SOURCES))
C_SOURCES=$(wildcard *.c)
C_OBJECTS = $(patsubst %.c, %.o, $(C_SOURCES))
C_DEPENDS = $(patsubst %.c, %.d, $(C_SOURCES))
.PHONY: all clean obj
all : $(TARGET)
$(TARGET) : obj
$(CXX) $(CFLAGS) -o $@ $(CPP_OBJECTS) $(C_OBJECTS) $(LIBS) $(INCLUDE)
obj : $(C_OBJECTS) $(CPP_OBJECTS)
-include $(C_DEPENDS)
-include $(CPP_DEPENDS)
$(CPP_OBJECTS) : %.o : %.cpp
$(CXX) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< $(INCLUDE)
$(C_OBJECTS) : %.o : %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $&l