I post this question on stack overflow, but no one answer me. This is link: Question on Stackflow
I tried to use dnn module of Opencv 3.1.0 to do some object detection, which I follow tutorial here: Opencv dnn module tutorial
From my understanding, extra module, which contain dnn module, should be built with Opencv source. So I follow this tutorial: Build Opencv with Extra Modules
However, when I try to compile this simple code in Microsoft Visual Studio 2013,
#include <opencv2\dnn.hpp>
#include <opencv2\core.hpp>
using namespace cv;
using namespace cv::dnn;
void main() {
}
The result was:
1>------ Rebuild All started: Project: WithDnnModule, Configuration: Debug Win32 ------ 1> DnnTest.cpp 1>DnnTest.obj : error LNK2019: unresolved external symbol "private: void __thiscall cv::String::deallocate(void)" (?deallocate@String@cv@@AAEXXZ) referenced in function "public: __thiscall cv::String::~String(void)" (??1String@cv@@QAE@XZ) 1>C:\Rescourse\Project\opencvdnn\WithDnnModule\Debug\WithDnnModule.exe : fatal error LNK1120: 1 unresolved externals ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
If I don't include opencv2\dnn.hpp, I can build the code successfully.
Please help me out.