簡體   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