0

Many question exist about this problem. But I don't undertsand what I do clearly.

I installed aruco_msvc10 from here. Then I integrate vs2010 using below steps:

  1. Create a Win32 console application
  2. Choose Configuration Manager... and add x64 platform
  3. At release,
    3.1. At Configuration Properties ---- C/C++ ---- Additional Include Directories, add aruco_msvc2010/include, msvc2010/include/aruco

    3.2. At Configuration Properties ---- Linker ---- Additional Library Directories, add library folder aruco_msvc2010\lib

    3.3 At configuration field, choose Release mode, add aruco124.lib

  4. . Add aruco_msvc2010\bin to System Environment Path

Then I run my code, I get an error via error LNK2001: unresolved external symbol "public: __cdecl aruco::MarkerDetector::MarkerDetector(void)" (??0MarkerDetector@aruco@@QEAA@XZ)

There is only one main.cpp file on my project.Should I add markerDetector.h file to the project?

Code :

#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <aruco\aruco.h>
#include <aruco\cvdrawingutils.h>
using namespace cv;

int main()
{
VideoCapture cap(0); // open the default camera
int iSliderValue1 = 50, iSliderValue2 = 255;
Mat thresholdImage;
Mat frame;
aruco::MarkerDetector marker;
std::cout << "---------------- \n";
return 0;
}
cycle cyletic
  • 67
  • 2
  • 10
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Vinz Feb 17 '15 at 09:01

1 Answers1

0

Some possibilities:

  • You're adding the lib to the release config but are trying to do a debug build

  • The lib you're adding is not matching your build (e.g. debug/release or 32/64 bit mismatch)

  • You're not adding the lib file in the correct place (under Additional Dependencies in Linker)

user2599140
  • 476
  • 2
  • 9
  • I select release and x64 from vs2010 interface, run with ctrl+f5. Also I check addtional dependecies. There is a aruco124.lib under aruco_msvc/lib folder. I add aruco124.lib to linker->input->additional dependencies – cycle cyletic Feb 17 '15 at 12:51