# OpenCV Compiling ### Command-line ```shell g++ *.cpp -o output_name `pkg-config --cflags --libs opencv4` ``` ### Makefile ```shell= # Define target file and source files TARGET = test SRCS = $(wildcard *.cpp) # Compiler and its options CXX = g++ CXXFLAGS = `pkg-config --cflags opencv4` LDFLAGS = `pkg-config --libs opencv4` # Rule: Compile the target $(TARGET): $(SRCS) $(CXX) $(CXXFLAGS) -o $(TARGET) $(SRCS) $(LDFLAGS) # Rule: Clean up generated files clean: rm -f $(TARGET) run: $(TARGET) ./$(TARGET) # Alaways rebuild .PHONY: $(TARGET) clean ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up