Very slow VS2017 C++ linker speed - c++

We're upgrading our C++ projects from VS2013 to VS2017. But in VS2017 we have very bad linking times also for Debug builds. With such values, it's not possible to do effective development.
When I change the single file in our project, in VS2013 it takes 2.6sec. When I do the same with the same file in VS2017 it takes 30sec.
VS2013
1> 32 ms ComputeCLOutputs 1 calls
1> 199 ms WarnCompileDuplicatedFilename 1 calls
1> 2688 ms Link 1 calls
1> 4073 ms ClCompile 1 calls
VS2017
1> 31 ms ComputeCLOutputs 1 calls
1> 44 ms CustomBuild 1 calls
1> 239 ms WarnCompileDuplicatedFilename 1 calls
1> 8021 ms ClCompile 1 calls
1> 29725 ms Link 1 calls
This is more than 15x slower than in VS2013.
Currently, I have both Visual Studios installed on my PC so I can test it side-by-side. I tried a lot of things as same as a lot of googling but without success.
I tried:
compile the same project in VS2017 but with VS2013 toolset and linking takes 2.6sec. So the problem is with toolset in VS2017 not with VS2017 IDE.
I tried a lot of combinations with DebugInformationFormat like /Zi and /Z7, as same as /DEBUG vs /DEBUG:Fastlink, /INCREMENTAL,... but any other settings is even worse than default one generated by QMake (/Zi + /DEBUG:Fastlink + /INCREMENTAL).
I also tried 32bit and 64bit compiler/linker as same as 32/64bit target. But it doesn't have any impact on performance.
I tried to convert VS2013 project to VS2017 as same as generating new one via Qt Qmake but also without any differences.
During link time CPU isn't used at 100% as same as SSD drive isn't utilized at 100%. I tried to output verbose linking log but there isn't anything special (no foreign temporary files, etc. like mentioned in other answers).
This is complete compiler command line
/Yu"stdafx.h" /MP /GS /analyze- /W3 /wd"4577" /wd"4467" /Zc:wchar_t /I ...INCLUDE FOLDERS... /Zi /Gm- /Od /Fd"objs\Debug32\" /FI"stdafx.h" /fp:precise
/D "_WINDOWS" /D "UNICODE" /D "WIN32" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /MDd /Fa"objs\Debug32\" /EHsc /nologo /Fo"objs\Debug32\"
/Fp"Debug32\\App.pch" /diagnostics:classic
-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zm130 -w44996 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458
And linker command line
/OUT:"Debug32\\App.exe" /MANIFEST /NXCOMPAT /PDB:"Debug32\App.pdb" /DYNAMICBASE "Q:\SharedLibraries2017\Qt32\lib\qtmaind.lib" "shell32.lib" ...
/VERSION:"1.0" /DEBUG /MACHINE:X86 /SAFESEH /INCREMENTAL /PGD:"Debug32\App.pgd" /SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/ManifestFile:"_App\objs\Debug32\App.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"Q:\SharedLibraries2017\Qt32\lib" /TLBID:1
"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
I found few some posts about slow linking but nothing helped for me (64bit, erasing temporary files, turning of synchro/sourcurce control/codelens/diagnostic, clean build in new folders, ... ).
I'm using latest VS2017 version 15.5.6, toolset v141, SDK 10.0.16299.0
Any help will be appreciated.
Added:
My PC setup is:
i7-7700K CPU # 4.2Ghz
16GB Ram
SSD Drive
Latest Win10
Edited:
I tried another (smaller) project.
When I do complete rebuild, I got these results:
VS2013:
1> 2898 ms Link 1 calls
1> 11987 ms CustomBuild 1 calls
1> 68238 ms ClCompile 1 calls
VS2017
1> 2822 ms Link 1 calls
1> 14221 ms CustomBuild 1 calls
1> 67243 ms ClCompile 1 calls
So almost identical results. But, when I change for example main.cpp in both projects and do compilation+link, I got this:
VS2013:
1> 577 ms Link 1 calls
1> 1261 ms ClCompile 1 calls
VS2017
1> 1196 ms ClCompile 1 calls
1> 3145 ms Link 1 calls
So, the problem seems to be that no mather how many files are linked together, in VS2017 the time is still the same.
Edit2:
Based on #seccur idea I installed also VS2015 toolkit
Again, two same projects, both fully compiled & linked and in both I moddified main.cpp file.
VS2015 (2015 v140)
1> 64 ms WarnCompileDuplicatedFilename 1 calls
1> 594 ms Link 1 calls
1> 1312 ms ClCompile 1 calls
VS2017 (2017 v141)
1> 43 ms WarnCompileDuplicatedFilename 1 calls
1> 754 ms ClCompile 1 calls
1> 2082 ms Link 1 calls
Both projects opened in VS2017 IDE, both with same settings, the only difference is toolkit selection. It's more than clear that v141 toolkit is completely bugged.

Related

Why does VS2019 Pro have compile errors with xutility, xmemory, and atomic when creating a CUDA project via CMake?

I'm trying to create a simple CUDA project via CMake and getting strange compilation errors. I'm following this tutorial.
Originally, I was using Visual Studio 2019 Community, CMake 3.18.3, and CUDA 11.3 and everything worked fine. Then, I updated to Visual Studio 2019 Professional and CMake 3.20.3, and it failed to compile the same exact same source code.
Here's my entire CMakeLists file:
cmake_minimum_required(VERSION 3.18.3)
project(hello_world LANGUAGES CXX CUDA)
add_executable(hello_world_target main.cu)
target_compile_features(hello_world_target PUBLIC cxx_std_11)
set_target_properties(hello_world_target PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_target_properties(hello_world_target PROPERTIES CUDA_ARCHITECTURES "52")
Here's my only source file, main.cu:
#include <iostream>
int main(){
std::cout << "Hello, world!" << std::endl;
return 0;
}
When I try to compile, I get the following errors:
1>Compiling CUDA source file ..\main.cu...
1>
1>C:\Users\[username]\Documents\hello_cmake\build>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc.exe" -gencode=arch=compute_52,code=\"compute_52,compute_52\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64" -x cu -rdc=true -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -std=c++14 -Xcompiler="/EHsc -Zi -Ob0" -g -D_WINDOWS -D"CMAKE_INTDIR=\"Debug\"" -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -Xcompiler "/EHsc /W1 /nologo /Od /Fdhello_world_target.dir\Debug\vc142.pdb /FS /Zi /RTC1 /MDd /GR" -o hello_world_target.dir\Debug\main.obj "C:\Users\[username]\Documents\hello_cmake\main.cu"
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\include\xutility(1309): error : expected a "("
1> detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter=const char *, _Sentinel=const char *]"
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\include\xlocale(1990): here
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\include\xutility(1309): error : expected a "("
1> detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter=__wchar_t *, _Sentinel=__wchar_t *]"
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\include\xlocale(1991): here
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\include\xutility(1309): error : expected a "("
1> detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter=const __wchar_t *, _Sentinel=const __wchar_t *]"
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\include\xlocale(2026): here
.....etc., etc., etc.....
31 errors detected in the compilation of "C:/Users/[username]/Documents/hello_cmake/main.cu".
1>main.cu
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.3.targets(785,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc.exe" -gencode=arch=compute_52,code=\"compute_52,compute_52\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64" -x cu -rdc=true -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -std=c++14 -Xcompiler="/EHsc -Zi -Ob0" -g -D_WINDOWS -D"CMAKE_INTDIR=\"Debug\"" -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -Xcompiler "/EHsc /W1 /nologo /Od /Fdhello_world_target.dir\Debug\vc142.pdb /FS /Zi /RTC1 /MDd /GR" -o hello_world_target.dir\Debug\main.obj "C:\Users\[username]\Documents\hello_cmake\main.cu"" exited with code 1.
1>Done building project "hello_world_target.vcxproj" -- FAILED.
What's perplexing is that this worked fine with the different versions of Visual Studio and CMake. Also, if I rewrite the CMakeLists.txt file to remove CUDA from the LANGUAGES list, and change main.cu to main.cpp, everything works fine.
It's also confusing that the compiler would complain about the xutility, xmemory, and atomic files. That sounds like a red herring, though.
What could be causing this issue?
UPDATE 10/20/2021: For me, VS2019 16.11.5 works fine with CUDA 11.4.120 and CMake 3.21.3, no modifications needed.
I ran into basically the same problem after upgrading from Visual Studio 2019 16.9.6 to 16.10.
The problem seems to be caused by changes in xutility, xmemory etc. in the version of the MSVC v142 build tools 14.29.30037 delivered with Visual Studio 2019 16.10.
I could not solve the problem for the new version of the build tools, but I found a workaround. It is possible to install the v142 build tools from VS2019 16.9 with VS2019 16.10:
In VS the installer, "Visual Studio 2019->Modify->Individual components" add
MSVC v142 - VS2019 C++ x64/x86 build tools (14.28-16.9)
C++ v14.28 (16.9) ATL for v142 build tools (x86 & x64)
optionally: MFC, commandline tools, etc.
To compile the CUDA CMake project the MSVC toolset version needs to be set explicitly. This can be done by entering
version=14.28.29910
in "Optional toolset to use (argument to -T) in the CMake GUI (CMake cache needs to be deleted).
Nothing wrong with the program and with the MSVC compiler and libs. You can use the latest release (now 16.10.1)
cmake generated this (chaotic) compiler command in the vs 2019 IDE:
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc.exe" -gencode=arch=compute_75,code="compute_75,compute_75" -gencode=arch=compute_75,code="sm_75,compute_75" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64" -x cu -rdc=true -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -std=c++14 -Xcompiler="/EHsc -Ob2" -D_WINDOWS -DNDEBUG -D"CMAKE_INTDIR="Release"" -D_MBCS -D"CMAKE_INTDIR="Release"" -Xcompiler "/EHsc /W1 /nologo /O2 /Fdhello_world_target.dir\Release\vc142.pdb /FS /MD /GR" -o hello_world_target.dir\Release\main.obj "D:\projects\test\main.cu"
remove additional option: -std=c++14 in this command and it works
Why:
With cuda 11.3 and MSVC 19.29.++ MSVC arranges itself the setting for the host compiler icw NVCC, so using this option gives problems.
It must be edited in the CMAKE release. Module compiler(NVIDIA-CUDA.cmake) I think. I'm not an expert on that, but you can see there a lot of hocus-pocus around this option.
Also Windows Visual Studio does not support specifying CUDAHOSTCXX or CMAKE_CUDA_HOST_COMPILER env settings and gives problems like this.
I used cmake version 3.20.3 and win-build 3.20.20210609-g5e26887 to test.

Running CMake from CreateProcess returns FileTracker FTK0001 error

After updating my windows 10 to 1903, executing the following cmake command using CreateProcess:
command: cmd /C "cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_TOOLCHAIN_FILE="D:/vcpkg/scripts/buildsystems/vcpkg.cmake"" ..
code: CreateProcess("C:\\Windows\\System32\\cmd.exe", command, NULL, NULL, FALSE, NULL, 0, workingDir, &si, &pi))
fails to find the compiler:
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Configuring incomplete, errors occurred!
but succeeds (finds the correct MSVC compiler) when the exact same command is executed directly from the command prompt.
After digging through the trace, I found out that CMakeDetermineCompilerId.cmake fails when compiling CompilerIdC.vcxproj with the following:
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /I"D:\vcpkg\installed\x64-windows\include" /nologo /W0 /WX- /diagnostics:classic /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc141.pdb" /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c
FileTracker : error FTK0001: could not attach tracking. The storage
control block address is invalid.
[D:\[path redacted]\CMakeFiles\3.12.2\CompilerIdC\CompilerIdC.vcxproj]
this is the only error, all trace output before this, including versions and paths, are exactly the same as when successfully compiled from the command line.
How do I fix this error, or is this a problem with CreateProcess?
(This code works with no problems on Windows 10 1803 with the exact same compilers)
I found the answer: the Child Process Debugging extension produces this problem after the update. Disabling this extension fixes the problem.

I failed to create obj file in Flutter desktop embedding project (on visual studio)

I'm trying to build flutter desktop embedding example project
(https://github.com/google/flutter-desktop-embedding)
I stuck on fail to create some obj files
I tried to include folder (flutter_desktop_embedding\library\include)
and other "include" folders. but still keep failing.
here are the log
1>Run the embedder library's GN build
1>Done. Made 14 targets from 12 files in 16ms
1>ninja: Entering directory `E:\flutter_desktop\flutter_desktop_embedding\example\windows_fde\scripts\..\..\..\out'
1>[1/41] CXX obj/library/common/client_wrapper/src/client_wrapper.engine_method_result.obj
1>FAILED: obj/library/common/client_wrapper/src/client_wrapper.engine_method_result.obj
1>vcvars64.bat 1> nul && cl /nologo /showIncludes /MDd /FC -DUSE_FDE_TREE_PATHS -I../library/include -I.. -I../library/common/client_wrapper/include -I../third_party/jsoncpp/src/include /EHsc /W3 /Od /c ../library/common/client_wrapper/src/engine_method_result.cc /Foobj/library/common/client_wrapper/src/client_wrapper.engine_method_result.obj /Fdobj/library/common/client_wrapper/client_wrapper_c.pdb
1>CreateProcess failed: The system cannot find the file specified.
1>[2/41] CXX obj/library/common/client_wrapper/src/client_wrapper_internal.json_message_codec.obj
1>FAILED: obj/library/common/client_wrapper/src/client_wrapper_internal.json_message_codec.obj
1>vcvars64.bat 1> nul && cl /nologo /showIncludes /MDd /FC -DUSE_FDE_TREE_PATHS -DFLUTTER_DESKTOP_EMBEDDING_IMPL -I../library/include -I.. -I../library/common/client_wrapper/include -I../third_party/jsoncpp/src/include /EHsc /W3 /Od /c ../library/common/client_wrapper/src/json_message_codec.cc /Foobj/library/common/client_wrapper/src/client_wrapper_internal.json_message_codec.obj /Fdobj/library/common/client_wrapper/client_wrapper_internal_c.pdb
1>CreateProcess failed: The system cannot find the file specified.
This isn't an include path problem; the system cannot find the file specified error is while trying to launch the process.
Either you don't have vcvars64.bat in your path as described in the setup instructions, or you don't have cl.exe installed.
To figure out which problem you have, run tools/run_dart_tool doctor. It will tell you whether vcvars64.bat is in your path.

How to prevent Visual Studio project setting overriding command line SET CL options

I need to build a Visual Studio 2012 project unchanged using Visual Studio 2015 and am finding that Visual Studio 2015 seems to have changed rules and now a Windows API function is deemed deprecated. I have found I can change compile options via the command line using SET CL but this command line options is being overridden.
I need to find a way to force the command line option to be used.
Here is the source code:
/*
1>e:\code\compile_cmd_line\main.cpp(15): warning C4996: 'GetVersionExA': was declared deprecated
1> c:\program files (x86)\windows kits\8.1\include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
*/
// with below line uncommented, builds in Visual Studio 2015 IDE ok
// #pragma warning(disable: 4996) // error C4996: 'GetVersionExA': was declared deprecated
#include <windows.h>
int main() {
OSVERSIONINFOA vi = { };
BOOL ret = GetVersionExA(&vi);
}
The compiler options in the project file are:
/GS /GL /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Fd"Release\vc140.pdb" /Zc:inline /fp:precise /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MD /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\compile_cmd_line.pch"
The problem settings are SDL checks /sdl and Security check /GS
Here is how I try to compile using VS2015:
E:\code\compile_cmd_line>set CL=/sdl- /GS-
E:\code\compile_cmd_line>devenv /useenv /build "Release|x86" compile_cmd_line.sln
Microsoft Visual Studio 2015 Version 14.0.25420.1.
Copyright (C) Microsoft Corp. All rights reserved.
The license for Visual Studio expires in 20 days.
1>------ Build started: Project: compile_cmd_line, Configuration: Release Win32
------
1>cl : Command line warning D9025: overriding '/sdl-' with '/GS-'
1>cl : Command line warning D9025: overriding '/GS-' with '/sdl'
1> main.cpp
1>main.cpp(20): error C4996: 'GetVersionExA': was declared deprecated
1> C:\Program Files (x86)\Windows Kits\8.1\include\um\sysinfoapi.h(433): note:
see declaration of 'GetVersionExA'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
E:\code\compile_cmd_line>
The problem lines:
1>cl : Command line warning D9025: overriding '/sdl-' with '/GS-'
1>cl : Command line warning D9025: overriding '/GS-' with '/sdl'
For completeness, I have a setup script to setup the env vars for the MS build tools:
call "%VS140COMNTOOLS%vsvars32.bat"
set INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt;%INCLUDE%
set LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;%LIB%
Is there a better way to do this?
Can I force the override using SET CL?

Build error with "___report_rangecheckfailure" with OpenSSL libs

Using VC++ 2010
Compiling with OpenSSL libraries to make a SHA512 hash...
getting this build error:
1>------ Build started: Project: Second, Configuration: Debug Win32 ------
1> stdafx.cpp
1> AssemblyInfo.cpp
1>Second.cpp
1> Second.cpp(64): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf'
1> Generating Code...
1> .NETFramework,Version=v4.0.AssemblyAttributes.cpp
1> Microsoft (R) Incremental Linker Version 10.00.40219.01
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> "/OUT:C:\Users\Boss\documents\visual studio 2010\Projects\Second\Debug\Second.exe" /INCREMENTAL "C:\Program Files\OpenSSL-Win32\lib\VC\static\ssleay32MD.lib" "C:\Program Files\OpenSSL-Win32\lib\VC\static\libeay32MD.lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /ASSEMBLYRESOURCE:Debug\Second.Form1.resources /MANIFEST "/ManifestFile:Debug\Second.exe.intermediate.manifest" "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /DEBUG "/PDB:C:\Users\Boss\documents\visual studio 2010\Projects\Second\Debug\Second.pdb" /ASSEMBLYDEBUG /SUBSYSTEM:WINDOWS /TLBID:1 "/ENTRY:main" /DYNAMICBASE /FIXED:NO /NXCOMPAT /MACHINE:X86 Debug\app.res
1> Debug\AssemblyInfo.obj
1> Debug\Second.obj
1> Debug\stdafx.obj
1> "Debug\.NETFramework,Version=v4.0.AssemblyAttributes.obj"
1>libeay32MD.lib(obj_dat.obj) : error LNK2019: unresolved external symbol ___report_rangecheckfailure referenced in function _OBJ_create_objects
1>libeay32MD.lib(b_print.obj) : error LNK2001: unresolved external symbol ___report_rangecheckfailure
1>C:\Users\Boss\documents\visual studio 2010\Projects\Second\Debug\Second.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Tried disabling buffer overrun security check, same error..
Any thoughts? Tried all day with Crypto++, to no avail, OpenSSL was much easier, just hung up on this one error...
It looks as though you are trying to link to OpenSSL libraries that were built with a later version of the compiler.
Function ___report_rangecheckfailure was introduced in more recent versions of Visual Studio (see http://blogs.microsoft.com/cybertrust/2012/01/26/enhancements-to-gs-in-visual-studio-11/ for details).
So the linker is looking in the VS2010 libraries to find a function that didn't exist until later.
The maintainer of at least one of the pre-built OpenSSL libraries for Windows has recently switched from using an earlier version of Visual Studio, which may be the trigger for your problems.
One solution is to build your own OpenSSL Windows binaries with VS2010 (See http://developer.covenanteyes.com/building-openssl-for-visual-studio/ for example).