如何在dev c ++中使用opencv

时间:2016-07-28 16:12:46

标签: c++ opencv dev-c++

我最近下载了opencv库,我需要在一些代码中使用它。但是我一直在接收"未定义的引用::"消息,我已经尝试了我在网上找到的所有内容,但没有运气。 你可以给我一个关于如何配置所有东西以便它运行的破败程序吗? 对不起,如果这是一个模糊的问题

以下是受影响代码的摘录:

#include <iostream>
#include <windows.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <conio.h>
#include <stdio.h>
#include <ctime>

#include         "C:\Users\nideangelis\Desktop\opencv\build\include\opencv2\opencv.hpp"
#include "C:\Users\nideangelis\Desktop\opencv\build\include\opencv2\core\core.hpp"
#include "C:\Users\nideangelis\Desktop\opencv\build\include\opencv2\highgui\highgui.hpp"
#include "C:\Users\nideangelis\Desktop\opencv\build\include\opencv2\imgproc\imgproc.hpp"
#include "C:\Users\nideangelis\Desktop\CImg_latest\CImg-1.7.5_pre072216\CImg.h"

int main(int argc, char** argv){
//code

cv::Mat Ref;
Ref= cv::Mat(Nxr, Nyr, CV_32FC1, &ref);
int newref[Nxr][Nyr];
cv::Mat Newref;
cv::Mat xii;
xii= cv::Mat((maxX-minX)/dxe+1, (maxY-minY)/dye+1, CV_32FC1, &xi);
cv::Mat yii;
yii= cv::Mat((maxX-minX)/dxe+1, (maxY-minY)/dye+1, CV_32FC1, &yi);
cv::remap(Ref, Newref, xii, yii, CV_INTER_LINEAR);
//code
}

错误:

C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text+0x29c6): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text+0x29dc): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text+0x29f2): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text+0x2a08): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text+0x2a45): undefined reference to `cv::remap(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::_InputArray const&, int, int, cv::Scalar_<double> const&)'
C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text$_ZN2cv3MatD1Ev[_ZN2cv3MatD1Ev]+0x36): undefined reference to `cv::fastFree(void*)'
C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text$_ZN2cv3MataSERKS0_[_ZN2cv3MataSERKS0_]+0x119): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
C:\Users\NIDEAN~1\AppData\Local\Temp\ccPEwngN.o GammaFML.cpp:(.text$_ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x48): undefined reference to `cv::Mat::deallocate()'
C:\Users\nideangelis\Desktop\collect2.exe   [Error] ld returned 1 exit status

0 个答案:

没有答案