2015-06-15 2 views
1

Мне нужна ваша помощь. Я пытаюсь связать внешнюю библиотеку с Qt Creator я получаю три ошибки LNK2019Ссылка на внешнюю библиотеку в QT Creator

mainwindow.obj:-1: error: LNK2019: unresolved external symbol ""void __cdecl cv::projectPoints(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_OutputArray const &,double)" ([email protected]@@[email protected]@[email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: unresolved external symbol ""bool __cdecl cv::solvePnP(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_OutputArray const &,bool,int)" ([email protected]@@[email protected]@[email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: unresolved external symbol ""bool __cdecl cv::findChessboardCorners(class cv::_InputArray const &,class cv::Size_<int>,class cv::_OutputArray const &,int)" ([email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 

мой .pro-файл

QT  += core gui widgets 
TARGET = beispiel 
TEMPLATE = app 


SOURCES += main.cpp\ 
     mainwindow.cpp 

HEADERS += mainwindow.h 

FORMS += mainwindow.ui 

INCLUDEPATH += C:/opencv/build/include/ 

LIBS += -LC:/opencv/build/x64/vc12/lib \ 
     -lopencv_calib3d249 \ 
     -lopencv_core249 \ 
     -lopencv_highgui249 \ 
     -lopencv_imgproc249 

Я установил opencv3.0 надеясь, что это исправить, но это не сделал.

Любая помощь будет оценена по достоинству.


сейчас я потерял все.

Я очистил и перестроил проект. теперь я получаю 16 ошибок связи.

mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""private: char * __thiscall cv::String::allocate(unsigned int)" ([email protected]@[email protected]@[email protected])" in Funktion ""public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" ([email protected]@@[email protected]@Z)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""private: void __thiscall cv::String::deallocate(void)" ([email protected]@[email protected]@AAEXXZ)" in Funktion ""public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" ([email protected]@@[email protected]@Z)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::error(int,class cv::String const &,char const *,char const *,int)" ([email protected]@@[email protected]@[email protected])" in Funktion ""public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" ([email protected]@@[email protected]@Z)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""class cv::_InputOutputArray const & __cdecl cv::noArray(void)" ([email protected]@@[email protected]@XZ)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: virtual bool __thiscall cv::FileStorage::open(class cv::String const &,int,class cv::String const &)" ([email protected]@[email protected]@[email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::findContours(class cv::_InputOutputArray const &,class cv::_OutputArray const &,int,int,class cv::Point_<int>)" ([email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@Z)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::line(class cv::_InputOutputArray const &,class cv::Point_<int>,class cv::Point_<int>,class cv::Scalar_<double> const &,int,int,int)" ([email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected]@Z)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::circle(class cv::_InputOutputArray const &,class cv::Point_<int>,int,class cv::Scalar_<double> const &,int,int,int)" ([email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected]@Z)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::ellipse(class cv::_InputOutputArray const &,class cv::Point_<int>,class cv::Size_<int>,double,double,double,class cv::Scalar_<double> const &,int,int,int)" ([email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected][email protected]@[email protected]@Z)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::ellipse(class cv::_InputOutputArray const &,class cv::RotatedRect const &,class cv::Scalar_<double> const &,int,int)" ([email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@Z)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::projectPoints(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_OutputArray const &,double)" ([email protected]@@[email protected]@[email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""bool __cdecl cv::solvePnP(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_OutputArray const &,bool,int)" ([email protected]@@[email protected]@[email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""bool __cdecl cv::findChessboardCorners(class cv::_InputArray const &,class cv::Size_<int>,class cv::_OutputArray const &,int)" ([email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: virtual bool __thiscall cv::VideoCapture::read(class cv::_OutputArray const &)" ([email protected]@[email protected]@[email protected]@@Z)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::namedWindow(class cv::String const &,int)" ([email protected]@@[email protected]@[email protected])" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 
mainwindow.obj:-1: error: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl cv::imshow(class cv::String const &,class cv::_InputArray const &)" ([email protected]@@[email protected]@[email protected]@@Z)" in Funktion ""private: int __thiscall MainWindow::on_ButtonVideo_clicked(void)" ([email protected]@@AAEHXZ)". 

это мой весь код:

#include "mainwindow.h" 

using namespace cv; 
using namespace std; 
Point prevCenter_bl; 
Point prevCenter_gr; 
Point prevCenter_rd; 
int boardHeight = 6; 
int boardWidth = 9; 
Size cbSize = Size(boardHeight,boardWidth); 

string filename = "out_camera_data.yml"; 
//default image size 
const int FRAME_WIDTH = 640; 
const int FRAME_HEIGHT = 480; 

//function prototypes 
//void generate_boardPoints(); 

MainWindow::MainWindow(QWidget *parent) : 
    QMainWindow(parent), 
    ui(new Ui::MainWindow) 
{ 
    ui->setupUi(this); 
    connect(ui->ButtonVideo, SIGNAL(clicked()), this, SLOT(on_ButtonVideo_clicked())); 
    connect(ui->ButtonVideoRelease, SIGNAL(clicked()), this, SLOT(on_ButtonVideoRelease_clicked())); 
    // connect(ui->videoFrame, SIGNAL(clicked()), this, SLOT(on_ButtonVideoRelease_clicked())); 
} 

MainWindow::~MainWindow() 
{ 
    delete ui; 
} 


int MainWindow::on_ButtonVideo_clicked() 
{ 
    ///init_chess_board 
    //set up a FileStorage object to read camera params from file 
    FileStorage fs; 
    fs.open(filename, FileStorage::READ); 
    // read camera matrix and distortion coefficients from file 
    Mat intrinsics, distortion; 
    fs["Camera_Matrix"] >> intrinsics; 
    fs["Distortion_Coefficients"] >> distortion; 
    // close the input file 
    fs.release(); 

    //set up matrices for storage 
    Mat webcamImage, gray, one; 
    Mat rvec = Mat(Size(3,1), CV_64F); 
    Mat tvec = Mat(Size(3,1), CV_64F); 

    //setup vectors to hold the chessboard corners in the chessboard coordinate system and in the image 
    vector<Point2d> imagePoints, imageFramePoints, imageOrigin; 
    vector<Point3d> boardPoints, framePoints; 

    //generate vectors for the points on the chessboard 
    for (int i=0; i<boardWidth; i++) 
    { 
     for (int j=0; j<boardHeight; j++) 
     { 
      boardPoints.push_back(Point3d(double(i), double(j), 0.0)); 
     } 
    } 
    //generate points in the reference frame 
    framePoints.push_back(Point3d(0.0, 0.0, 0.0)); 
    framePoints.push_back(Point3d(5.0, 0.0, 0.0)); 
    framePoints.push_back(Point3d(0.0, 5.0, 0.0)); 
    framePoints.push_back(Point3d(0.0, 0.0, 5.0)); 


    ///init_ellipse_tracking 
// namedWindow("Control"); //create a window called "Control" 
    int iLowH_bl = 104;  //0 
    int iHighH_bl = 179; //179 
    int iLowS_bl = 86;  //0 
    int iHighS_bl = 255; //255 
    int iLowV_bl = 0;  //0 
    int iHighV_bl = 255; //255 
    int sliderPos_bl = 70; //70 

    int iLowH_gr = 87;  //0 
    int iHighH_gr = 102; //179 
    int iLowS_gr = 108;  //0 
    int iHighS_gr = 238; //255 
    int iLowV_gr = 78;  //0 
    int iHighV_gr = 175; //255 
    int sliderPos_gr = 70; //70 

    int iLowH_rd = 0;  //0 
    int iHighH_rd = 34; //179 
    int iLowS_rd = 68;  //0 
    int iHighS_rd = 255; //255 
    int iLowV_rd = 58;  //0 
    int iHighV_rd = 117; //255 
    int sliderPos_rd = 70; //70 

    //Create trackbars in "Control" window 
// cvCreateTrackbar("LowH", "Control", &iLowH, 179); //Hue (0 - 179) 
// cvCreateTrackbar("HighH", "Control", &iHighH, 179); 
// cvCreateTrackbar("LowS", "Control", &iLowS, 255); //Saturation (0 - 255) 
// cvCreateTrackbar("HighS", "Control", &iHighS, 255); 
// cvCreateTrackbar("LowV", "Control", &iLowV, 255); //Value (0 - 255) 
// cvCreateTrackbar("HighV", "Control", &iHighV, 255); 
    //cvCreateTrackbar("Ellipse", "Control", &sliderPos, 255); 

// cvResizeWindow("Control", 220, 50); 

    Mat imgOriginal; 
    VideoCapture cap(0); //capture the video from web cam 
    capture.set(CV_CAP_PROP_FRAME_WIDTH,FRAME_WIDTH); 
    capture.set(CV_CAP_PROP_FRAME_HEIGHT,FRAME_HEIGHT); 
    if (!cap.isOpened()) // if not success, exit program 
    { 
     cout << "Cannot open the web cam" << endl; 
     return -1; 
    } 


    while (true) 
    { 
     /// chess_board 
     //store image to matrix 
     capture.read(webcamImage); 

     //make a gray copy of the webcam image 
     cvtColor(webcamImage,gray,COLOR_BGR2GRAY); 


     //detect chessboard corners 
     bool found = findChessboardCorners(gray, cbSize, imagePoints, CALIB_CB_FAST_CHECK); 
     //drawChessboardCorners(webcamImage, cbSize, Mat(imagePoints), found); 



     //find camera orientation if the chessboard corners have been found 
     if (found) 
     { 
      //find the camera extrinsic parameters 
      solvePnP(Mat(boardPoints), Mat(imagePoints), intrinsics, distortion, rvec, tvec, false); 

      //project the reference frame onto the image 
      projectPoints(framePoints, rvec, tvec, intrinsics, distortion, imageFramePoints); 


      //DRAWING 
      //draw the reference frame on the image 
      circle(webcamImage, (Point) imagePoints[0], 4 ,CV_RGB(255,0,0)); 

      Point one, two, three; 
      one.x=10; one.y=10; 
      two.x = 60; two.y = 10; 
      three.x = 10; three.y = 60; 

      line(webcamImage, one, two, CV_RGB(255,0,0)); 
      line(webcamImage, one, three, CV_RGB(0,255,0)); 


      line(webcamImage, imageFramePoints[0], imageFramePoints[1], CV_RGB(255,0,0), 2); 
      line(webcamImage, imageFramePoints[0], imageFramePoints[2], CV_RGB(0,255,0), 2); 
      line(webcamImage, imageFramePoints[0], imageFramePoints[3], CV_RGB(0,0,255), 2); 



      //show the pose estimation data 
      cout << fixed << setprecision(2) << "rvec = [" 
        << rvec.at<double>(0,0) << ", " 
        << rvec.at<double>(1,0) << ", " 
        << rvec.at<double>(2,0) << "] \t" << "tvec = [" 
        << tvec.at<double>(0,0) << ", " 
        << tvec.at<double>(1,0) << ", " 
        << tvec.at<double>(2,0) << "]" << endl; 

     } 

     //show the image on screen 
     namedWindow("OpenCV Webcam", 0); 
     imshow("OpenCV Webcam", webcamImage); 


     //show the gray image 
     //namedWindow("Gray Image", CV_WINDOW_AUTOSIZE); 
     //imshow("Gray Image", gray); 

     /// ellipse_tracking 
     bool bSuccess = cap.read(imgOriginal); // read a new frame from video 
     if (!bSuccess) //if not success, break loop 
     { 
      cout << "Cannot read a frame from video stream" << endl; 
      break; 
     } 
     Mat imgHSV_bl; 
     Mat imgHSV_gr; 
     Mat imgHSV_rd; 
     cvtColor(imgOriginal, imgHSV_bl, COLOR_BGR2HSV); //Convert the captured frame from BGR to HSV 
     cvtColor(imgOriginal, imgHSV_gr, COLOR_BGR2HSV); //Convert the captured frame from BGR to HSV 
     cvtColor(imgOriginal, imgHSV_rd, COLOR_BGR2HSV); //Convert the captured frame from BGR to HSV 
     Mat imgThresholded_bl; 
     Mat imgThresholded_gr; 
     Mat imgThresholded_rd; 
     inRange(imgHSV_bl, Scalar(iLowH_bl, iLowS_bl, iLowV_bl), Scalar(iHighH_bl, iHighS_bl, iHighV_bl), imgThresholded_bl); //Threshold the image 
     inRange(imgHSV_gr, Scalar(iLowH_gr, iLowS_gr, iLowV_gr), Scalar(iHighH_gr, iHighS_gr, iHighV_gr), imgThresholded_gr); //Threshold the image 
     inRange(imgHSV_rd, Scalar(iLowH_rd, iLowS_rd, iLowV_rd), Scalar(iHighH_rd, iHighS_rd, iHighV_rd), imgThresholded_rd); //Threshold the image 

     //morphological opening (remove small objects from the foreground) 
     erode(imgThresholded_bl, imgThresholded_bl, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     erode(imgThresholded_gr, imgThresholded_gr, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     erode(imgThresholded_rd, imgThresholded_rd, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     dilate(imgThresholded_bl, imgThresholded_bl, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     dilate(imgThresholded_gr, imgThresholded_gr, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     dilate(imgThresholded_rd, imgThresholded_rd, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 

     //morphological closing (fill small holes in the foreground) 
     dilate(imgThresholded_bl, imgThresholded_bl, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     dilate(imgThresholded_gr, imgThresholded_gr, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     dilate(imgThresholded_rd, imgThresholded_rd, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     erode(imgThresholded_bl, imgThresholded_bl, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     erode(imgThresholded_gr, imgThresholded_gr, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 
     erode(imgThresholded_rd, imgThresholded_rd, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 

//  imshow("Thresholded Image Blue", imgThresholded_bl); //show the thresholded image 
//  imshow("Thresholded Image Green", imgThresholded_gr); //show the thresholded image 
//  imshow("Thresholded Image Red", imgThresholded_rd); //show the thresholded image 
     //imshow("Original", imgOriginal); //show the original image 

     ///#### End sticker color selection #### 

     vector<vector<Point> > contours_bl; 
     vector<vector<Point> > contours_gr; 
     vector<vector<Point> > contours_rd; 
      Mat bimage_bl = imgThresholded_bl >= sliderPos_bl; 
      Mat bimage_gr = imgThresholded_gr >= sliderPos_gr; 
      Mat bimage_rd = imgThresholded_rd >= sliderPos_rd; 

      findContours(bimage_bl, contours_bl, CV_RETR_LIST, CV_CHAIN_APPROX_NONE); 
      findContours(bimage_gr, contours_gr, CV_RETR_LIST, CV_CHAIN_APPROX_NONE); 
      findContours(bimage_rd, contours_rd, CV_RETR_LIST, CV_CHAIN_APPROX_NONE); 

      for(size_t i = 0; i < contours_bl.size(); i++){ 
       size_t count = contours_bl[i].size(); 
       if(count < 6) 
        continue; 
       Mat pointsf; 
       Mat(contours_bl[i]).convertTo(pointsf, CV_32F); 
       RotatedRect box = fitEllipse(pointsf); 
       prevCenter_bl.x = box.center.x; 
       prevCenter_bl.y = box.center.y; 
       ellipse(imgOriginal, box, Scalar(0,0,255), 1, CV_AA); 
       ellipse(imgOriginal, box.center, box.size*0.0001f, box.angle, 0, 360, Scalar(0,255,255), 1, CV_AA); 

       line(imgOriginal, box.center, prevCenter_gr, cv::Scalar(0,255,0), 1, CV_AA); 

      } 
      for(size_t i = 0; i < contours_gr.size(); i++){ 
       size_t count = contours_gr[i].size(); 
       if(count < 6) 
        continue; 
       Mat pointsf; 
       Mat(contours_gr[i]).convertTo(pointsf, CV_32F); 
       RotatedRect box = fitEllipse(pointsf); 
       prevCenter_gr.x = box.center.x; 
       prevCenter_gr.y = box.center.y; 
       ellipse(imgOriginal, box, Scalar(0,0,255), 1, CV_AA); 
       ellipse(imgOriginal, box.center, box.size*0.0001f, box.angle, 0, 360, Scalar(0,255,255), 1, CV_AA); 

       line(imgOriginal, box.center, prevCenter_rd, cv::Scalar(0,255,0), 1, CV_AA); 

      } 
      for(size_t i = 0; i < contours_rd.size(); i++){ 
       size_t count = contours_rd[i].size(); 
       if(count < 6) 
        continue; 
       Mat pointsf; 
       Mat(contours_rd[i]).convertTo(pointsf, CV_32F); 
       RotatedRect box = fitEllipse(pointsf); 
       prevCenter_rd.x = box.center.x; 
       prevCenter_rd.y = box.center.y; 
       ellipse(imgOriginal, box, Scalar(0,0,255), 1, CV_AA); 
       ellipse(imgOriginal, box.center, box.size*0.0001f, box.angle, 0, 360, Scalar(0,255,255), 1, CV_AA); 

       line(imgOriginal, box.center, prevCenter_bl, cv::Scalar(0,255,0), 1, CV_AA); 

      } 
      imshow("result", imgOriginal); 
      waitKey(10); 
    } 
      return 0; 

} 

void MainWindow::on_ButtonVideoRelease_clicked() 
{ 
    if(capture.isOpened()) 
    capture.release(); 
} 

заголовок:

#ifndef MAINWINDOW_H 
#define MAINWINDOW_H 

#include <QMainWindow> 
#include <opencv2/opencv.hpp> 
#include <opencv/cv.hpp> 
#include "ui_mainwindow.h" 
#include <opencv2/calib3d/calib3d.hpp> 
#include <opencv2/highgui/highgui.hpp> 
#include <opencv2/imgproc/imgproc.hpp> 
#include <opencv2/core/core.hpp> 
#include <opencv2/features2d/features2d.hpp> 
#include <opencv2/calib3d/calib3d.hpp> 
#include <iostream> 
#include <stdio.h> 
#include <string> 
#include <iomanip> 

namespace Ui { 
class MainWindow; 
} 

class MainWindow : public QMainWindow 
{ 
    Q_OBJECT 

public: 
    explicit MainWindow(QWidget *parent = 0); 
    ~MainWindow(); 

private: 
    Ui::MainWindow *ui; 
    cv::VideoCapture capture; 

private slots: 
    int on_ButtonVideo_clicked(); 
    void on_ButtonVideoRelease_clicked(); 
}; 

#endif // MAINWINDOW_H 

и .pro

QT  += core gui widgets 

TARGET = beispiel 
TEMPLATE = app 


SOURCES += main.cpp\ 
     mainwindow.cpp 

HEADERS += mainwindow.h 

FORMS += mainwindow.ui 

INCLUDEPATH += C:/opencv/build/include/ 

LIBS += -LC:/opencv/build/x64/vc12/lib \ 
     -lopencv_calib3d249 \ 
     -lopencv_core249 \ 
     -lopencv_highgui249 \ 
     -lopencv_imgproc249 \ 

это все та же. У меня есть opencv 2.4.9. и 3.0, поэтому есть такие библиотеки в папке C:/opencv/build/x64/vc12/lib и C:/opencv/build/x64/vc12/staticlib.

В чем разница между lib и staticlib? может кто-нибудь помочь PLS?

+0

Как вы установили opencv? Опишите, потому что тогда кто-то может найти ошибку. – Marged

+1

Я загрузил самораспаковывающийся файл с сайта opencv, извлеченный в c: –

+0

. Пути, созданные самораспаковывающимся, соответствуют указанным в вашем проекте (C:/opencv/build/x64/vc12/lib)? Если да, добавьте эту деталь в свой вопрос (используйте кнопку редактирования), потому что все читатели вашего вопроса должны это знать. – Marged

ответ

0

Вы пытаетесь связать одну или несколько библиотек, которые не существуют:

opencv_calib3d249 

Когда я проверяю содержимое OpenCV 3.0 SFX я могу видеть только эти библиотеки:

opencv\build\x64\vc11\staticlib\opencv_calib3d300.lib 
opencv\build\x64\vc12\staticlib\opencv_calib3d300.lib 
opencv\build\x86\vc11\staticlib\opencv_calib3d300.lib 
opencv\build\x86\vc12\staticlib\opencv_calib3d300.lib 

Поэтому мне кажется, что и путь к libs (C:/opencv/build/x64/vc12/lib), и номер версии в файлах (249) неверны.

Если вы хотите, чтобы заглянуть внутрь .lib файлов ссылающихся для того, чтобы выяснить, какие методы они экспортируют, используйте команду, подобную этой:

dumpbin opencv_calib3d300.lib /symbols 

Dumpbin является частью Visual Studio, есть много информации, доступной на SO, например here.

 Смежные вопросы

  • Нет связанных вопросов^_^