Building Setup file with third- party DLL

105 views Asked by At

I'm setting up a setup file for my app through "Batch Build" tool of Visual Studio to run on other machine, but the problem is that in my code contains 2 DLL: "OpenCV" and "Chilkat". They make the compiler confused because compiler can't find their directory even though it works completely fine while I use "Build Solution".

I have tried 2 method:

  1. Add the dll to the dll of Visual Studio

"D:\Visual Studio 2015\VC\include\", but the result is quite awful. I can't understand the errors what it says. Here is one of those errors.

Error   LNK2019 unresolved external symbol "void __cdecl cv::warpAffine(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_InputArray const &,class cv::Size_<int>,int,int,class cv::Scalar_<double> const &)" (?warpAffine@cv@@YAXAEBV_InputArray@1@AEBV_OutputArray@1@0V?$Size_@H@1@HHAEBV?$Scalar_@N@1@@Z) referenced in function "class cv::Mat __cdecl rotate(class cv::Mat &,double,struct CvPoint)" (?rotate@@YA?AVMat@cv@@AEAV12@NUCvPoint@@@Z)
  1. Use the static directory to all the third party dll. Like this:


    #include <D:/OpenCV3.0/opencv/build/include/opencv2/opencv.hpp>

But it still fails because the header file only uses dynamic directory. It means if I use this way I have to change the directory of all header file.

The question is: How can I make the compiler recognize my third party dll when I use "Batch Build"? If anyone know something about this, please let me know. Thanks a lot. Here is the code and the error

#include "cpprest/containerstream.h"
#include "cpprest/filestream.h"
#include "cpprest/http_client.h"
#include "cpprest/json.h"
#include "cpprest/producerconsumerstream.h"
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <cstring>
#include <string>
#include <D:/Chilkat/chilkat-9.5.0-x86-vc2015/include/CkBinData.h>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/opencv.hpp>
#include <D:/Chilkat/chilkat-9.5.0-x86-vc2015/include/CkXml.h>
#include <D:/Chilkat/chilkat-9.5.0-x86-vc2015/include/CkJsonObject.h>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/core/core.hpp>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/highgui/highgui.hpp>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/imgproc/imgproc.hpp>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/objdetect/objdetect.hpp>
#include <D:/Chilkat/chilkat-9.5.0-x86-vc2015/include/CkMime.h>
#include <D:/Chilkat/chilkat-9.5.0-x86-vc2015/include/CkByteData.h>
#include <D:/Chilkat/chilkat-9.5.0-x86-vc2015/include/CkFileAccess.h>
#include "conio.h"
#include <fstream>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/face.hpp>
#include <direct.h>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/face/facerec.hpp>
#include <D:/OpenCV3.0/opencv/build/include/opencv2/highgui/highgui.hpp>

Error C1083 Cannot open include file: 'opencv2/core.hpp': No such file or directory MicrosoftFaceAPI

0

There are 0 answers