使用第三方DLL构建安装文件

时间:2019-03-29 07:53:07

标签: c++ opencv dll visual-studio-2015 batch-build

我正在通过 Visual Studio “批处理构建” 工具为我的应用设置安装文件,以在其他计算机上运行,​​但问题是代码包含2个DLL: "OpenCV""Chilkat"。它们使编译器感到困惑,因为即使在我使用“ Build Solution” 时,即使编译器工作正常,也无法找到其目录。

我尝试了两种方法:

  1. 将dll添加到Visual Studio的

"D:\Visual Studio 2015\VC\include\",但结果非常糟糕。我无法理解错误的含义。这是其中一种错误。

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. 使用静态目录访问所有第三方dll。像这样:


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

但是它仍然失败,因为头文件仅使用动态目录。这意味着如果使用这种方式,我必须更改所有头文件的目录。

问题是::当我使用“批量生成”时,如何使编译器识别我的第三方dll? 如果有人对此有所了解,请告诉我。非常感谢。 这是代码和错误

#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>

错误C1083无法打开包含文件:'opencv2 / core.hpp':没有此类文件或目录MicrosoftFaceAPI

0 个答案:

没有答案