繁体   English   中英

OpenCV Raspberry Pi printf()不显示

[英]OpenCV Raspberry Pi printf() not displaying

我正在尝试在Raspberry pi上使用OpenCV进行图像处理。 我已经安装了相关的软件包和OpenCV,但是由于某种原因,我什至无法编译甚至连printf();也不能编译printf();

#include <iostream>
#include <stdio.h>

using namespace std;

int main(){
printf("hello world");
return 0;
}

使用g ++ filename.cpp运行此命令后,控制台上的输出为空,它不会打印任何内容,但会询问下一个命令。 我有什么想念的吗?

为了成功编译您的OpenCV项目,您必须链接到OpenCV库。

在命令行上编译时,我总是使用pkg-config链接所需的库。

安装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