我在 Qt 中有这个奇怪的错误:LNK1104: cannot open file 'C:\OpenCV246PC\build\x86\vc10\lib.obj'
Qt 中的设置与 VS2010 中的设置相同(它们工作正常),但这里 Qt 抱怨它找不到文件,即使我根本看不到对 x86 库的明显引用!
这是我的 *.pro 设置:
#-------------------------------------------------
#
# Project created by QtCreator 2013-07-12T14:50:04
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = myQtConsoleProject
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:\OpenCV246PC\build\include
LIBS += -LC:\OpenCV246PC\build\x86\vc10\lib \
-lopencv_core246d \
-lopencv_highgui246d \
-lopencv_imgproc246d \
-lopencv_features2d246d \
-lopencv_calib3d246d
这是我正在尝试编译的简单代码
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
int main ()
{
// read an image
cv::Mat image = cv::imread("img.jpg");
// create image window named "My Image"
cv::namedWindow("My Image");
// show the image window
cv::imshow("My Image", image);
// wait key for 5000 ms
cv::waitKey(5000);
return 1;
}