Install boost:
A) Download boost library:http://www.boost.org/
b) Install boost:
- Unzip boost to any folder
- Bootstrap
- ./b2
c) Verify that:
- Configure environment variables:$BOOST _home
- VS creates the console project.
- To configure the include path for the project, the Library directory:
- Compile to execute the following code:
#include "stdafx.h"
#include <iostream>
#include <string>
#include <boost/regex.hpp>
int main ()
{
Boost::regex pattern ("\\[email protected]\\w+ (\\.\\w+) *");
Std::string Mail ("[email protected]");
if (boost::regex_match (mail, pattern)) {
Std::cout << Mail << "is a valid mail address!" << Std::endl;
}
else {
Std::cout << Mail << "is not a valid mail address!" << Std::endl;
}
System ("pause");
}
Installing OpenSSL:
- Install ActivePerl(download msi online to install)
- Download the OpenSSL package
- Using the VS command-line tool , go to unzip folder and enter command:perl Configure vc-win64a
- ms\do_win64a
- NMAKE –F Ms\ntdll.mak
- If the compilation is successful, you can test it using nmake -F ms\nt.mak test
Installing Thrift
- Download Thrift package, unzip.
- Apache official website said in Windows compiled thrift need Cygwin or MINGW, so compiled results are. O. A and other Linux/unix connection libraries, and can not be used as. Lib by vs directly. In fact, after the download package is unpacked, there is a thrift.sln under lib\cpp\ that can be opened directly with VS and compiled Libthrift.lib, which is well used in other VS projects.
- If you need to compile LIBTHRIFTNB, you need to install libevent additional. In my project, you only need to use the thrift client, so there is no compilation.
- Configure OpenSSL,boost header files.
- Compile generates Lib\cpp\debug\libthrift.lib, there are some warnings, but finally it is successful and good to use.
Visual studio/thrift C + + environment configuration, compiling and installing