How do I compile MySQL Connector C++ with MinGW-W64? - mysql

I am attempting to compile the MySQL Connector CPP version 8.0.20.
Source code from https://github.com/mysql/mysql-connector-cpp. (Downloaded 2020-May-24)
Following instructions at https://forums.mysql.com/read.php?117,426293,426927.
Step 3 of compiling produced the following command output:
e:\cpp\Lib\MySQL>cmake -G "MinGW Makefiles"
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building version 8.0.20
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
Building on system: Windows-10.0.18362 (AMD64)
Using cmake generator: MinGW Makefiles
Using toolset:
Building 64bit code
Building shared connector library
Configuring CDK as part of MySQL_CONCPP project
-- Looking for SSL library.
CMake Error at cdk/cmake/DepFindSSL.cmake:79 (message):
Cannot find appropriate system libraries for SSL. Make sure you've
specified a supported SSL version. Consult the documentation for WITH_SSL
alternatives
Call Stack (most recent call first):
cdk/cmake/DepFindSSL.cmake:346 (main)
cdk/cmake/dependency.cmake:42 (include)
cdk/CMakeLists.txt:96 (find_dependency)
-- Setting up Protobuf.
==== Configuring Protobuf build using cmake generator: MinGW Makefiles
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
Using pthreads for protobuf code
-- Configuring done
-- Generating done
-- Build files have been written to: E:/cpp/Lib/MySQL/cdk/protobuf
==== Protobuf build configured.
Processor Count: 8
-- Setting up RapidJSON.
Skipping second declaration of config option: THROW_AS_ASSERT (found in: E:/cpp/Lib/MySQL/cdk/CMakeLists.txt)
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Performing Test HAVE_IS_SAME
-- Performing Test HAVE_IS_SAME - Failed
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- ZSTD_LEGACY_SUPPORT not defined!
-- Performing Test HAVE_SHARED_PTR
-- Performing Test HAVE_SHARED_PTR - Success
-- Performing Test HAVE_SYSTEM_ERROR
-- Performing Test HAVE_SYSTEM_ERROR - Success
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/byteorder.h
-- Looking for sys/byteorder.h - not found
Wrote configuration header: E:/cpp/Lib/MySQL/cdk/include/mysql/cdk/config.h
Preparing to merge SHARED library: connector (xapi;devapi)
Connector library name: mysqlcppconn8-2
Building version 8.0.20
Generating INFO_SRC
Generating INFO_BIN
Install location: C:/Users/jvines/MySQL/MySQL Connector C++
Connector libraries will be installed at: lib64
Project configuration options:
: BUILD_STATIC: OFF
Build static version of connector library
: WITH_SSL: system
Either 'system' to use system-wide OpenSSL library, or custom OpenSSL location. (default : system)
: WITH_JDBC: OFF
Whether to build a variant of connector library which implements legacy JDBC API
-- Configuring incomplete, errors occurred!
See also "E:/cpp/Lib/MySQL/CMakeFiles/CMakeOutput.log".
See also "E:/cpp/Lib/MySQL/CMakeFiles/CMakeError.log".
Links to log files:
CMakeOutput.log
CMakeError.log
All files in the /CMakeTmp directory, referenced in CMakeError.log, have been deleted by the script so I can't analyze them.
Main question:
How do I fix this to finally produce the desired build files so I can move on to the next step?
Additional questions:
Where does the referenced src.cxx, and, by extension, the src.cxx.obj, file come from?
How do I eliminate the SSL error, as shown in the command output? Re:
-- Looking for SSL library.
CMake Error at cdk/cmake/DepFindSSL.cmake:79 (message):
Cannot find appropriate system libraries for SSL. Make sure you've
specified a supported SSL version. Consult the documentation for WITH_SSL
alternatives
UPDATE #1
Now using MSYS2 with MinGW-w64. The missing SSL error is eliminated.
New error at the Make step:
e:\cpp\Lib\MySQL\src> make
MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
Error makefile 11: Colon expected
*** 1 errors during make ***
make command replaced with mingw32-make produced new errors. This post is getting long, Please follow the link for the full text of the output.
New command output.
There is no mysql_ps_resultset.cpp to edit, as referenced in Step 4.

Related

How to compile mysql-server example plugins

I want to write a information schema plugin for mysql,and first Im trying to compile the example plugins and have some errors.
The CmakeList.txt is this:
MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc
MODULE_ONLY TEST_ONLY MODULE_OUTPUT_NAME "libdaemon_example")
INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Test)
It is said Unknown Cmake command "MYSQL_ADD_PLUGIN",
Selecting Windows SDK version 10.0.16299.0 to target Windows 6.1.7601.
The C compiler identification is MSVC 19.11.25547.0
The CXX compiler identification is MSVC 19.11.25547.0
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:16 (MYSQL_ADD_PLUGIN):
Unknown CMake command "MYSQL_ADD_PLUGIN".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.11)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
See also "C:/Program Files/CMake/bin/CMakeFiles/CMakeOutput.log".
I found this function is in mysql-server\cmake file,
MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;CLIENT_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_FOR_EMBEDDED;RECOMPILE_FOR_EMBEDDED;TEST_ONLY"
${ARGN}
)
I wonder how to fix it and make the compile success?
error image

clsql-mysql on the Windows platform (Clozure CL)

I am attempting to use clsql-mysql on the Windows platform. I am using 32 bit Clozure CL with the 32 bit MySQL Connector library (from Oracle) to provide the external library.
I added the path of the connector to %path% so that clsql could find the connector library, and connecting to the database with
(clsql:connect '("host" "db" "user" "pw"))
Which goes without a hitch and returns a <MYSQL_DATABASE> object.
When I attempt to do a simple SQL query, however, I get the following error:
;; Query
(clsql:query "select * from logentry where id = 3346;")
;; Error:
`Can't resolve foreign symbol "clsql_mysql_field_flags"`
Could this be something to do with the way that the mysql connector is compiled? from the INFO_BIN file supplied with the MySQL Connector:
===== Information about the build process: =====
Build was run at Thu 07/13/2017 on host 'VITRO50'
Build was done on Windows-6.2 using AMD64
Build was done using cmake 3.2.3
===== Compiler / generator used: =====
Visual Studio 14 2015
Pointer size: 4
===== Feature flags used: =====
-- Cache values
CANDLE_EXECUTABLE:FILEPATH=C:/Program Files (x86)/WiX Toolset v3.10/candle.exe
CMAKE_CONFIGURATION_TYPES:STRING=DebugReleaseMinSizeRelRelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/LibMySQL
COMMUNITY_BUILD:BOOL=ON
DEBUG_EXTNAME:BOOL=ON
ENABLED_PROFILING:BOOL=ON
ENABLE_DEBUG_SYNC:BOOL=ON
ENABLE_GCOV:BOOL=OFF
ENABLE_GPROF:BOOL=OFF
EXTRA_INSTALL:BOOL=G:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs12-win32/lib/mysqlclient.liblib/vs12DevelopmentG:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs12-win32/lib/debug/mysqlclient.liblib/vs12/debugDebugBinariesG:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs14-win32/lib/mysqlclient.liblib/vs14DevelopmentG:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs14-win32/lib/debug/mysqlclient.liblib/vs14/debugDebugBinaries
FEATURE_SET:STRING=community
HEAT_EXECUTABLE:FILEPATH=C:/Program Files (x86)/WiX Toolset v3.10/heat.exe
INSTALL_LAYOUT:STRING=STANDALONE
LIGHT_EXECUTABLE:FILEPATH=C:/Program Files (x86)/WiX Toolset v3.10/light.exe
MYSQL_DATADIR:PATH=C:/Program Files/MySQL/MySQL Server 6.1/data
MYSQL_KEYRINGDIR:PATH=C:/Program Files/MySQL/MySQL Server 6.1/keyring
MYSQL_MAINTAINER_MODE:BOOL=OFF
PKG_INSTALL_PREFIX:PATH=C:/Program Files (x86)/LibMySQL
TMPDIR:PATH=
WIN_DEBUG_NO_INLINE:BOOL=OFF
WITH_ARCHIVE_STORAGE_ENGINE:BOOL=ON
WITH_ASAN:BOOL=OFF
WITH_BLACKHOLE_STORAGE_ENGINE:BOOL=ON
WITH_CLIENT_PROTOCOL_TRACING:BOOL=ON
WITH_DEBUG:BOOL=OFF
WITH_DEFAULT_COMPILER_OPTIONS:BOOL=ON
WITH_DEFAULT_FEATURE_SET:BOOL=ON
WITH_EMBEDDED_SERVER:BOOL=ON
WITH_EXTRA_CHARSETS:STRING=all
WITH_FEDERATED_STORAGE_ENGINE:BOOL=ON
WITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
WITH_MSAN:BOOL=OFF
WITH_MSCRT_DEBUG:BOOL=OFF
WITH_NUMA:BOOL=ON
WITH_PARTITION_STORAGE_ENGINE:BOOL=ON
WITH_SSL:STRING=bundled
WITH_TEST_TRACE_PLUGIN:BOOL=OFF
WITH_UBSAN:BOOL=OFF
WITH_UNIT_TESTS:BOOL=OFF
WITH_ZLIB:STRING=bundled
WIX_DIR:PATH=C:/Program Files (x86)/WiX Toolset v3.10
===== EOF =====
The only hits I could find when searching for this error were ones that relate to a similar issue on Ubuntu.
How do I start to debug this error, or how do I fix this error so that the SQL query completes without error?

nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'

I've looked at many pages and either could not follow what they were saying because they were unclear and/or my knowledge is just not sufficient enough.
I am trying to run:
luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec
So that I may run DenseCap over some images using GPU Acceleration. When I run it, I get this error:
$ luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec
Using https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec... switching to 'build' mode
Cloning into 'stnbhwd'...
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 24 (delta 0), reused 14 (delta 0), pack-reused 0
Receiving objects: 100% (24/24), 19.42 KiB | 0 bytes/s, done.
Checking connectivity... done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/tex/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/tex/torch/install/lib/luarocks/rocks/stnbhwd/scm-1" && make
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /home/tex/torch/install
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Compiling with OpenMP support
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda (found suitable version "9.0", minimum required is "5.5")
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_stnbhwd-scm-1-4197/stnbhwd/build
Scanning dependencies of target stn
[ 25%] Building C object CMakeFiles/stn.dir/init.c.o
[ 50%] Linking C shared module libstn.so
[ 50%] Built target stn
[ 75%] Building NVCC (Device) object CMakeFiles/custn.dir/custn_generated_init.cu.o
nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'
CMake Error at custn_generated_init.cu.o.cmake:207 (message):
Error generating
/tmp/luarocks_stnbhwd-scm-1-4197/stnbhwd/build/CMakeFiles/custn.dir//./custn_generated_init.cu.o
CMakeFiles/custn.dir/build.make:63: recipe for target 'CMakeFiles/custn.dir/custn_generated_init.cu.o' failed
make[2]: *** [CMakeFiles/custn.dir/custn_generated_init.cu.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/custn.dir/all' failed
make[1]: *** [CMakeFiles/custn.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Error: Build error: Failed building.
I was able to luarocks install cutorch, luarocks install cunn, and luarocks install cudnn just fine.
I am running Ubuntu 16.04 on a GTX 1080ti.
$ nvidia-smi
Tue Dec 5 16:25:42 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90 Driver Version: 384.90 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 108... Off | 00000000:29:00.0 On | N/A |
| 0% 47C P8 16W / 250W | 716MiB / 11169MiB | 1% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1128 G /usr/lib/xorg/Xorg 479MiB |
| 0 1782 G compiz 234MiB |
+-----------------------------------------------------------------------------+
For some reason, when I run $ nvcc -V, I get:
The program 'nvcc' is currently not installed. You can install it by typing:
sudo apt install nvidia-cuda-toolkit
..and this is another big problem I am facing. When I install nvcc, it installs the toolkit for Cuda 7.5, but I have Cuda 9.0. I installed it using the .deb file that comes from Cuda's website.
$ sudo apt-get install cuda
Reading package lists... Done
Building dependency tree
Reading state information... Done
cuda is already the newest version (9.0.176-1).
The following packages were automatically installed and are no longer required:
libcublas7.5 libcudart7.5 libcufft7.5 libcufftw7.5 libcuinj64-7.5
libcurand7.5 libcusolver7.5 libcusparse7.5 libnppc7.5 libnppi7.5 libnpps7.5
libnvblas7.5 libnvrtc7.5 libnvtoolsext1 libnvvm3 libthrust-dev libvdpau-dev
nvidia-cuda-dev nvidia-cuda-doc nvidia-cuda-gdb nvidia-opencl-dev
nvidia-profiler nvidia-visual-profiler opencl-headers
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 222 not upgraded.
I honestly expect that I need to install nvcc, but like I said, it installs for the wrong version, and I cannot for the life of me figure out how to install it for the right version, and Im really confused as to why I am getting this error now even though I already installed cutorch, cudnn, and cunn just fine. Any help is appreciated...
Thanks
Try to change the code architecture (such as sm_20) to some higher version in CMakeLists.txt of stnbhwd that you are trying to install. From:
IF (CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_20")
to:
IF (CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_30")
As you mentioned:
but I have Cuda 9.0
Cuda 9.0 doesn't support SM_20 architecture (more info).
You have quite new gpu:
I am running Ubuntu 16.04 on a GTX 1080ti.
which is based on Pascal architecture (SM_60). So you probably don't need the support for SM_20 architecture.

I get this output trying to install MySQL Workbench on Debian Linux what should i do?

-- The C compiler identification is GNU 6.1.1
-- The CXX compiler identification is GNU 6.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.6/Modules/FindPkgConfig.cmake:49 (find_package_handle_standard_args)
CMakeLists.txt:37 (find_package)
-- Configuring incomplete, errors occurred!
See also "/root/Descargas/programas/mysql-workbench-community-6.3.7-src/wb-build/CMakeFiles/CMakeOutput.log".
I get this output error after typing cmake [-DCMAKE_INSTALL_PREFIX=/usr] ..

Failed to build libmysql on windows using vc2008

I want to build libmysql.dll, so I got source code mysql-connector-c-6.1.6-src.zip from http://dev.mysql.com/downloads/connector/c/.
Then cmake-gui.exe to configure and generate vc 2008 sln, leave all settings default.
Then got errors and warnings when building, like this:
mysql-connector-c-6.1.6-src\include\thr_cond.h(109) : error C2065: “ETIMEDOUT”: 未声明的标识符(an unspecified identifier)
mysql-connector-c-6.1.6-src\include\thr_rwlock.h(80) : warning C4013: “TryAcquireSRWLockShared” 未定义(not defined)
mysql-connector-c-6.1.6-src\include\thr_rwlock.h(102) : warning C4013: “TryAcquireSRWLockExclusive” 未定义(not defined)
I searched the source, and find ETIMEDOUT is defined in my_pthread.h, so I include this header in thr_cond.h, but still error.
And TryAcquireSRWLockShared and TryAcquireSRWLockExclusive seem only supported on Win7 and later !
Do I have done something wrong?
How can I build libmysql?
Any help will be appreciated.
Download the previous version (6.0.2), it doesn's use the TryAcquireSRWLockShared() API function.
With a few minor tweeks, it compiles clean with MSVC 2008.
Here are the modifications (based on the extracted zip file root):
Replace line 306 of include/config-win.h with:
// avoid annoying warning
#ifndef HAVE_COMPRESS
# define HAVE_COMPRESS
#endif
Comment lines 350-367 of CMakeLists.txt (CPack instructions cause CMake to fail)
Follow instructions in BUILD.win