简体   繁体   English

OpenCV Raspberry Pi printf()不显示

[英]OpenCV Raspberry Pi printf() not displaying

I am trying to make image processing using OpenCV on a Raspberry pi. 我正在尝试在Raspberry pi上使用OpenCV进行图像处理。 I've installed the relevant packages and OpenCV but for some reason I cannot manage to compile not even a printf(); 我已经安装了相关的软件包和OpenCV,但是由于某种原因,我什至无法编译甚至连printf();也不能编译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. 使用g ++ filename.cpp运行此命令后,控制台上的输出为空,它不会打印任何内容,但会询问下一个命令。 Is there anything I am missing? 我有什么想念的吗?

In order to successfully compile your OpenCV project you'll have to link against OpenCV libraries. 为了成功编译您的OpenCV项目,您必须链接到OpenCV库。

When compiling on the command-line I'm always using pkg-config to link against needed libraries. 在命令行上编译时,我总是使用pkg-config链接所需的库。

With pkg-config installed, try: 安装pkg-config后,请尝试:

g++ `pkg-config --libs --cflags opencv` -std=c++11 yourfile.cpp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM