Ask Your Question
0

error LNK2019 with OpenCV e ARuco

asked 2012-12-06 12:47:28 -0600

Cristina gravatar image

updated 2012-12-06 15:18:31 -0600

HI! I have a problem with Aruco Library. I downloaded Aruco from here: http://sourceforge.net/projects/aruco/ I'm on win7 x64 and I use VS2010. I wrote this simple code:

#include <iostream>
#include <stdio.h>
#include <string>   // for strings
#include <iomanip>  // for controlling float print precision
#include <sstream>  // string to number conversion
#include "C:/Users/Cristina/Desktop/OpenCV/dep/aruco/src/aruco.h"
#include "C:/Users/Cristina/Desktop/OpenCV/dep/aruco/src/cvdrawingutils.h"
#include "C:/Users/Cristina/Desktop/OpenCV/dep/aruco/src/cameraparameters.hpp"
#include "C:/Users/Cristina/Desktop/OpenCV/opencv/include/opencv/cv.h"
#include "C:/Users/Cristina/Desktop/OpenCV/opencv/include/opencv/highgui.h"
#include "C:/Users/Cristina/Desktop/OpenCV/opencv/modules/imgproc/include/opencv2/imgproc/imgproc.hpp"
#include "C:/Users/Cristina/Desktop/OpenCV/opencv/modules/highgui/include/opencv2/highgui/highgui.hpp"
#include "C:/Users/Cristina/Desktop/OpenCV/opencv/modules/core/include/opencv2/core/core.hpp"

using namespace cv;
using namespace aruco;

int main() {

    aruco::CameraParameters CamParam;
    aruco::MarkerDetector MDetector;
    vector <Marker> Markers;
    cv::Mat img;

    img = imread("prova marker", 0);

    cv::namedWindow("originale", 1);
    cv::namedWindow("risultato", 1);

    cv::Mat risultato;

    img.copyTo(risultato);

    MDetector.detect(img, Markers, CamParam, -1);

    for (int i=0; i< Markers.size(); i++) {

        Markers[i].draw(risultato, Scalar(0,0, 255));
    }

    cv::imshow("originale", img);
    cv::imshow("risultato", risultato);
    waitKey(0);

return 0;
}

But, when a click on Debug button, i receive a lot of warnings e this errors:

1>------ Inizio compilazione: Progetto: aruco marker, Configurazione: Debug Win32 ------
1>main.obj : error LNK2019: riferimento al simbolo esterno "public: __thiscall aruco::MarkerDetector::~MarkerDetector(void)" (??1MarkerDetector@aruco@@QAE@XZ) non risolto nella funzione _main
1>main.obj : error LNK2019: riferimento al simbolo esterno "public: void __thiscall aruco::Marker::draw(class cv::Mat &,class cv::Scalar_<double>,int,bool)const " (?draw@Marker@aruco@@QBEXAAVMat@cv@@V?$Scalar_@N@4@H_N@Z) non risolto nella funzione _main
1>main.obj : error LNK2019: riferimento al simbolo esterno "public: void __thiscall aruco::MarkerDetector::detect(class cv::Mat const &,class std::vector<class aruco::Marker,class std::allocator<class aruco::Marker> > &,class aruco::CameraParameters,float,bool)" (?detect@MarkerDetector@aruco@@QAEXABVMat@cv@@AAV?$vector@VMarker@aruco@@V?$allocator@VMarker@aruco@@@std@@@std@@VCameraParameters@2@M_N@Z) non risolto nella funzione _main
1>main.obj : error LNK2019: riferimento al simbolo esterno "public: __thiscall aruco::CameraParameters::CameraParameters(class aruco::CameraParameters const &)" (??0CameraParameters@aruco@@QAE@ABV01@@Z) non risolto nella funzione _main
1>main.obj : error LNK2019: riferimento al simbolo esterno "public: __thiscall aruco::MarkerDetector::MarkerDetector(void)" (??0MarkerDetector@aruco@@QAE@XZ) non risolto nella funzione _main
1>main.obj : error LNK2019: riferimento al simbolo esterno "public: __thiscall aruco::CameraParameters::CameraParameters(void)" (??0CameraParameters@aruco@@QAE@XZ) non risolto nella funzione _main
1>C:\Users\Cristina\Desktop\OpenCV\Progetti\MIEI PROGETTI\aruco marker\Debug\aruco marker.exe : fatal error LNK1120: 6 esterni non risolti
========== Compilazione: 0 completate, 1 non riuscite, 0 aggiornate, 0 ignorate ==========

I linked all possible opencv libraries (on linker-->input), but I have the same errors.

Can someone help me? Thanks.

edit retag flag offensive close merge delete

Comments

I've been googling it for hours and this kind of error refers to LINKER.. So I should link the aruco libraries to Linker, but there aren't .lib files in the package that I downloaded.

Cristina gravatar imageCristina ( 2012-12-06 15:23:01 -0600 )edit

Could you please help me.I've created a "aruco.lib" file and linked to the project but I still get the same errors.

mihaitensor gravatar imagemihaitensor ( 2014-08-08 17:14:17 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-12-07 05:54:43 -0600

ubehagelig gravatar image

updated 2012-12-07 06:34:54 -0600

I think the problem is that you have set everything up to run x64 (Library Directories), but your Debug and Release is set to run Win32. In the top where it says "Debug" and "Win32" click on the "Win32" and choose "Configuration Manager" and then choose x64.

Then it creates a "Debug | x64" and a "Release | x64" in the Property Manager. Those are the ones you need to use. Delete the Win32 Debug and Release, and add your property sheet to the Debug x64 and/or Release x64.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-12-06 12:47:28 -0600

Seen: 1,139 times

Last updated: Dec 07 '12