Skip to content

Instantly share code, notes, and snippets.

@kevinhughes27
Created April 4, 2013 15:51
Show Gist options
  • Save kevinhughes27/5311609 to your computer and use it in GitHub Desktop.
Save kevinhughes27/5311609 to your computer and use it in GitHub Desktop.
g++ Makefile for OpenCV Project
CC = g++
CFLAGS = -g -Wall
SRCS = HelloWorld.cpp
PROG = HelloWorld
OPENCV = `pkg-config opencv --cflags --libs`
LIBS = $(OPENCV)
$(PROG):$(SRCS)
$(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(LIBS)
@kavram
Copy link

kavram commented Jan 14, 2020

Thank you. I just needed to change OPENCV = pkg-config opencv --cflags --libs to OPENCV = pkg-config opencv4 --cflags --libs to make it to work since I have OpenCV 4.1.2 installed.

@ajayshinith
Copy link

when i use this i got
Makefile:10: *** missing separator. Stop.
how to solve it @kevin Hughes

@shigengtian
Copy link

@ajayshinith change space to tab

@burakekincioglu
Copy link

Thank you 👍

@WhaSukGO
Copy link

Thank you! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment