I am trying to make image processing using OpenCV on a Raspberry pi. I've installed the relevant packages and OpenCV but for some reason I cannot manage to compile not even a printf();
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
printf("hello world");
return 0;
}
After I run this using g++ filename.cpp , the output on the console is empty, it does not print anything but asks for the next command. Is there anything I am missing?
In order to successfully compile your OpenCV project you'll have to link against OpenCV libraries.
When compiling on the command-line I'm always using pkg-config to link against needed libraries.
With pkg-config installed, try:
g++ `pkg-config --libs --cflags opencv` -std=c++11 yourfile.cpp
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.