經過一些有用的技巧,這是這篇文章的新版本,事情是,它似乎我的程序以某種方式運行,但它只是出現一些錯誤......我不知道什麼它實際上提到,因爲庫安裝,我改變了路徑形式LIBS + = - LC:/usr/local/lib/ \
爲LIBS += -L/usr/local/lib/ \
,因爲有人說,它實際上指的是窗戶,而你使用Linux(查克拉),然後在目錄的末尾添加「\」並補充pkg配置我的.pro文件,所以這是一個新的問題,新版本的...:在Linux下使用Qt環境無法解析庫
Starting /home/lucifer/PR0J3CTs/FirstOpenCV-build-desktop-Qt_4_8_2_in_PATH__System__Release/FirstOpenCV...
/home/lucifer/PR0J3CTs/FirstOpenCV-build-desktop-Qt_4_8_2_in_PATH__System__Release/FirstOpenCV exited with code 0
Debugging starts
the debug information found in "/usr/lib/libQtOpenGL.so.4.8.2.debug" does not match "/usr/lib/libQtOpenGL.so.4" (CRC mismatch).
the debug information found in "/usr/lib/libQtGui.so.4.8.2.debug" does not match "/usr/lib/libQtGui.so.4" (CRC mismatch).
the debug information found in "/usr/lib/libQtCore.so.4.8.2.debug" does not match "/usr/lib/libQtCore.so.4" (CRC mismatch).
the debug information found in "/usr/lib/libQtTest.so.4.8.2.debug" does not match "/usr/lib/libQtTest.so.4" (CRC mismatch).
the debug information found in "/usr/lib/libQtNetwork.so.4.8.2.debug" does not match "/usr/lib/libQtNetwork.so.4" (CRC mismatch).
the debug information found in "/usr/lib/libQtXml.so.4.8.2.debug" does not match "/usr/lib/libQtXml.so.4" (CRC mismatch).
the debug information found in "/usr/lib/libQtSvg.so.4.8.2.debug" does not match "/usr/lib/libQtSvg.so.4" (CRC mismatch).
the debug information found in "/usr/lib/libQtDBus.so.4.8.2.debug" does not match "/usr/lib/libQtDBus.so.4" (CRC mismatch).
Debugging has finished
這是我的.pro配置[就像你看到我的評論(#)兩個LIBS配置之一,我只是想問問whi ch可能更準確或更有幫助,昨天我試過了,它發佈了一些不兼容的新版libavcodec,所以我搜索了一些並下載了libavcodec.53並配置了它,但我不確定現在會發生什麼,我現在在時刻試圖讓OpenCV的-QT參加的所有從CCR社區庫包,讓程序通過它自己處理這些問題,但我敢肯定它不會解決我的問題]:
QT += core
QT -= gui
TARGET = FirstOpenCV
CONFIG += console
CONFIG -= app_bundle
CONFIG += link_pkgconfig
PKGCONFIG += opencv
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += /usr/local/include/opencv2/
#LIBS += -L/usr/local/lib/ \
#-libopencv_core.so \
#-libopencv_highgui.so \
#-libopencv_imgproc.so \
#-libopencv_features2d \
#-libopencv_calib3d.so
LIBS += /usr/lib/libopencv_core.so \
/usr/lib/libopencv_highgui.so \
/usr/lib/libopencv_imgproc.so \
/usr/lib/libopencv_features2d.so \
/usr/lib/libopencv_calib3d.so \
/usr/lib/libavcodec.so
而且這裏的代碼:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main() {
// read an image
Mat image = imread("002.jpg");
// create image window named "My Image"
namedWindow("My Image");
// show the image on window
imshow("My Image", image);
// wait key for 5000 ms
waitKey(5000);
return 0;
}
我應該提到,第一個LIBS [註釋#1]的問題是沒有這樣的庫,但第一個被編譯並打開一個新的終端,它似乎只是不能顯示image ... –