Forum Discussion

DKam0's avatar
DKam0
Icon for New Contributor rankNew Contributor
6 years ago

how to include opencv for c/c++

I am using SoC EDS command shell in Window 10.

I don't know how to include opencv for compiling the c/c++ project

Even, I confuse whether the types of opencv is MingW or Linux or Window.

My Makefile is the same as the following

#

TARGET = main

#

ALT_DEVICE_FAMILY ?= soc_a10

SOCEDS_ROOT ?= $(SOCEDS_DEST_ROOT)

HWLIBS_ROOT = $(SOCEDS_ROOT)/ip/altera/hps/altera_hps/hwlib

OPENCV_PATH = $(SOCEDS_ROOT)/ip/altera/hps/altera_hps/OpenCV-MinGW-Build-OpenCV-4.1.0-x64

CROSS_COMPILE = arm-linux-gnueabihf-

CFLAGS = -g -Wall -D$(ALT_DEVICE_FAMILY) -I$(HWLIBS_ROOT)/include/$(ALT_DEVICE_FAMILY) -I$(HWLIBS_ROOT)/include/ -I$(OPENCV_PATH)/include/ -L$(OPENCV_PATH)/x64/mingw/lib

LDFLAGS = -g -Wall -L$(OPENCV_PATH)/x64/mingw/lib

CC = $(CROSS_COMPILE)g++

ARCH= arm

build: $(TARGET)

$(TARGET): main.o

$(CC) $(LDFLAGS) $^ -o $@

%.o : %.c

$(CC) $(CFLAGS) -c $< -o $@ -std=c++11

.PHONY: clean

clean:

rm -f $(TARGET) *.a *.o *~