Visual studio/thrift C + + environment configuration, compiling and installing

Source: Internet
Author: User

Install boost:

A) Download boost library:http://www.boost.org/

b) Install boost:

    1. Unzip boost to any folder
    2. Bootstrap
    3. ./b2

c) Verify that:

    1. Configure environment variables:$BOOST _home

    2. VS creates the console project.
    3. To configure the include path for the project, the Library directory:
    4. 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:

    1. Install ActivePerl(download msi online to install)
    2. Download the OpenSSL package
    3. Using the VS command-line tool , go to unzip folder and enter command:perl Configure vc-win64a
    4. ms\do_win64a
    5. NMAKE –F Ms\ntdll.mak
    6. If the compilation is successful, you can test it using nmake -F ms\nt.mak test

Installing Thrift

    1. Download Thrift package, unzip.
    2. 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.
    3. 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.
    4. Configure OpenSSL,boost header files.

    5. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.