问题
我正在使用Visual Studio 2012来开发C++ DLL.在某些机器上,无法加载这些DLL,因为缺少设置为"v110"的平台工具集.
我试图安装较旧的c ++运行时.它们没有安装,因为"已经安装了一个较新的版本".我还安装了当前的Windows SDK,但仍然没有其他项目可供选择而不是v110.
题
如何使用旧版本的C++运行时编译我的C++ DLL,以便它可以在非开发人员的机器上运行?

我需要为Visual Studio 2012 Update 4安装Microsoft Visual C++ Redistributable,但是当我运行它时,即使我选择了英语,它也会以中文打开.我尝试过三种不同的浏览器.当我右键单击Microsoft下载的文件时,它会在详细信息中显示英文.
我不熟悉Microsoft支持,我找不到任何报告任何地方的地方.我害怕安装它并造成任何损害.有什么建议?

我在使用OpenCV的C++中有这个功能:
vector<KeyPoint> test(Mat img)
{
int minHessian = 400;
SurfFeatureDetector detector( minHessian );
vector<KeyPoint> vKeypoints;
detector.detect( img, vKeypoints );
return vKeypoints;
}
Run Code Online (Sandbox Code Playgroud)
当我在main方法中调用此函数时,一切正常.
int main( int, char** argv )
{
// path to a image-file
char* input = "image.jpg";
// read image into Mat img
Mat img = imread( input, CV_LOAD_IMAGE_GRAYSCALE );
// call function test
test(img);
waitKey(0);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但是只要我两次打电话给这个方法......
int main( int, char** argv )
{
// path to a image-file
char* input = "image.jpg";
// read …Run Code Online (Sandbox Code Playgroud) 我正在使用 VS 2017 在调试模式下构建我的应用程序。我已经在发布模式下构建了它依赖并链接到的第 3 方库。这是允许的还是报告错误的原因。
LNK2038 mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in xxx.obj my-application <path-to>\libboost_filesystem-mt-s.lib(path_traits.obj) 1
Run Code Online (Sandbox Code Playgroud)
该页面指出:
RuntimeLibrary 指示应用程序或库使用的 C++ 标准库和 C 运行时的版本。使用一个版本的 C++ 标准库或 C 运行时的代码与使用不同版本的代码不兼容。有关详细信息,请参阅 /MD、/MT、/LD(使用运行时库)。
我知道 DLL 运行时库不能与非 DLL 库混合使用。调试和发布库也是如此吗?
我在 Linux 上做同样的事情没有任何问题。
我已经合并了 msm 与 2015 crt:
<DirectoryRef Id="TARGETDIR" >
<Merge Id = "Microsoft_VC140_CRT_x64.msm" FileCompression = "yes" Language = "1033" SourceFile = "..\\..\\..\\..\\..\\..\\..\\external\\tools\\systemsetups\\merge_modules\\Microsoft_VC140_CRT_x64.msm" DiskId = "1" />"
</DirectoryRef>
<Feature>
<Feature Id="Complete" Title="Complete" Absent="allow" Level="1">
...
<MergeRef Id="Microsoft_VC140_CRT_x64.msm"/>
...
</Feature>
Run Code Online (Sandbox Code Playgroud)
但我仍然收到:
---------------------------
MyApp.exe - System Error
---------------------------
The program can't start because mfc140u.dll is missing from your computer. Try reinstalling the program to fix this problem.
---------------------------
OK
---------------------------
Run Code Online (Sandbox Code Playgroud)
有什么想法如何正确合并它吗?