    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
    <ImportGroup Label="ExtensionSettings">
    </ImportGroup>
-@@ -63,54 +111,103 @@
+@@ -63,26 +111,50 @@
      <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
      <Import Project="..\include\tesseract_versionnumbers.props" />
    </ImportGroup>

+    <Lib>
+      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+    </Lib>
+    <PostBuildEvent>
+      <Message>copy library to lib directory</Message>
+      <Command>if not exist ..\..\..\lib md ..\..\..\lib
+copy "$(TargetPath)" ..\..\..\lib
+</Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='LIB_OpenCL_Debug|Win32'">
     <CustomBuildStep>
       <Message>
@@ -178,6 +308,39 @@ copy "$(TargetPath)" ..\..\..\lib
 </Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='LIB_OpenCL_Debug|x64'">
+    <CustomBuildStep>
+      <Message>

diff --git a/ccutil/platform.h b/ccutil/platform.h
index b793ee1..0fcdb44 100644
--- a/ccutil/platform.h
+++ b/ccutil/platform.h
@@ -28,7 +28,7 @@
 #define ultoa _ultoa
 #endif  /* __GNUC__ */
 #define SIGNED
-#if defined(_MSC_VER)
+#if _MSC_VER < 1900
 #define snprintf _snprintf
 #if (_MSC_VER <= 1400)
 #define vsnprintf _vsnprintf
diff --git a/viewer/svutil.h b/viewer/svutil.h
index 0d600ed..12384c4 100644
--- a/viewer/svutil.h
