Rebuild Crypto++ 5.6.2 for /MD release under Visual Studio 2013

霸气de小男生 提交于 2019-12-25 02:57:46

问题


I want to rebuild Crypto++ via MSVC 2013 so when I am using the library to be able to build my project with /MD or /MDd, NOT /MT or /MTd, because I am using QT 5.5.1 with MSVC2013 32bit compiler and it seems if I want to make GUI interface - it is using /MD or /MDd! In this article in section Static Versus Dynamic Linking is mentioned the necessity for rebuilding (not building) and how you can see from my other question I did it, but it is only working for debug mode. For Release mode the errors from 117 go to 53, but again the same old error occures:

cryptlib.lib(cryptlib.obj):-1: error: LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj

I am doing just what I mentioned here


回答1:


I want to rebuild Crypto++ via MSVC 2013...

OK, so the pain points here are the Microsoft changes to MSBuild at 2010. To make matters worse, VCUpgrade does a rather poor job of up-converting projects.

To help users with the upgrade process, Crypto++ provides a file called vs2010.zip. The archive contains the pre-converted solution file, project files and filters for Visual Studio 2010 and above. The files were released in October 2015 with a 5.6.3 Release Candidate.

The upgraded solution files are mostly successful. They build 20 of 24 configurations properly from the IDE. 4 of them fail on the first attempt; but the process recovers on the second attempt and builds all 24. We know its a dependency/ordering issue, but we don't know how to solve it. There's an open question on Stack Overflow at How to control order of Batch Build → Build All.

There is now a page on the subject of Visual Studio 2010 and VCUpgrade. See Visual Studio on the Crypto++ wiki.


In this article ...

I wrote that article years ago. You are on the right track.


I did it, but it is only working for debug mode. For Release mode the errors from 117 go to 53, but again the same old error occures:

cryptlib.lib(cryptlib.obj):-1: error: LNK2038: mismatch detected for 'RuntimeLibrary':
value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj

We added a ZIP file for you. The ZIP is a pre-converted Visual Studio 2010 solution and project files that utilizes dynamic runtime linking (/MD and /MDd). (Its not really just you since a lot of folks have asked about it over the years).

The solution to your problems are:

  1. download vs2010-dynamic.zip from the Crypto++ wiki
  2. unzip over top of the exiting Crypto++ distribution files.



回答2:


I am using cryptopp from source with /MD, built on vs2013 using the latest cryptopp version (5.6.2). You want to be up to date on encryption or security software, plus they may have fixed platform build issues.

The issues you cite sound like intermediate files from building a project with /MT set, even if it was later changed to /MD (although it is dangerously easy to forget to change the drop-down to "all configurations", and change just the debug settings in one project).

First clean solution, then make sure you change every project to /MD in [bold]all configurations[bold], and clean solution again. Now search for and delete any debug or release folders and .obj .lib .dll files, because I don't trust "clean solution". It can only get files it intends to build under the current settings, but the linker might find more in the link search (/verbose:lib).

Then rebuild all.



来源:https://stackoverflow.com/questions/33263734/rebuild-crypto-5-6-2-for-md-release-under-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!