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)
@saeidtafazzol
Copy link

thanks 👍

@ollewelin
Copy link

Also together with this basic's regarding Make was useful for me to understand
https://www.cs.bu.edu/teaching/cpp/writing-makefiles/#sep-compile

@tianyma
Copy link

tianyma commented Nov 8, 2018

Thank you very much!

@RailgunHamster
Copy link

Thanks!

@kangaroo02
Copy link

Thank you very much~

@Merofine
Copy link

Thank you very .... much

@oaix
Copy link

oaix commented May 8, 2019

Thank you very much. @ollewelin

@maheshkumarveloo
Copy link

Thank you ..super useful !!!

@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