Boost_1_34_1 compiled in C++builder6 (copies all DLL files to the Windows system directory, so Lib files are copied to the Bcb6\lib directory)

Source: Internet
Author: User
Tags throw exception

Boost_1_34_1.zip Boost Regular expression bcb6 compilation boost_1_34

There is a project to analyze a large amount of textual information, the previous method is to write their own functions and then analyze. Now found a regular expression of the processing method, in fact, the regular expression has long been known, but has been how to understand deeply, hehe, today found that the regular expression is really in the true aspect of winning a raise AH.

First to http://www.boost.org to download boost_1_34_1.zip (I am under Windows, so the download is zip, of course, according to different systems to download different packages. In fact, it is to go to an open source address to download. 23M bar). After downloading, extract to a directory, and then in command-line mode to this directory [%boost]\libs\regex\build, and then directly with the command Make-f Bcb6.mak, the final compilation is completed, will be in the [%boost]\ The Libs\regex\build directory generates a BCB directory where many lib files and DLL files are generated and all DLL files are copied to the Windows system directory, so Lib files are copied to the Bcb6\lib directory.

Then set the BCB6 project property to the Lib path and include path for you to install the Boost directory.

Let's look at an example:

Example begins-------------------------

#pragma hdrstop

#include "Unit1.h"
#include <boost/regex.hpp>
#include <string>

//---------------------------------------------------------------------------
#pragma package (smart_init)
#pragma resource "*.DFM"
TForm1 *form1;
//---------------------------------------------------------------------------
__fastcall Tform1::tform1 (tcomponent* Owner)
: Tform (Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall Tform1::button1click (tobject *sender)
{
try {
     char *src_str = " <meta http-equiv=\ "content-type\" content=\ "text/html; Charset=x-sjis\ ">"; 's really into like text column
     boost::regex rx ("<meta +http-equiv= (. *) +content= (. *) +charset= (. *) >", Boost::regex_constants::normal|boost::regex_constants::icase);
     boost::cmatch results;

if (Boost::regex_match (SRC_STR, results, rx) = = True) {
Ansistring s;
For (size_t i=1;i<results.size (); ++i) {
S + = "$" + inttostr (i) + "=" + ansistring (Results.str (i). C_STR ()) + "\ r \ n";
}
ShowMessage (s);
}
}
catch (Std::runtime_error &e) {
Throw Exception (E.what ());
}

}
//---------------------------------------------------------------------------

Example End-------------------------

and then compile, this time it is likely to be wrong : [Linker Fatal ERROR] Unable to open file ' Libboost_regex-bcb-mt-1_34_1.lib ' , I did not find this file in the Boost directory I compiled, very depressed. But this file is there.

And then on the Internet search for this similar error, did not find a solution, there is no libboost_regex-bcb-mt-1_34_1.lib related search results. Then I directly modified libboost_regex-bcb-mt-1_34.lib for Libboost_regex-bcb-mt-1_34_1.lib, and then compiled smoothly through, hehe

If you have a better solution to my message, or send me an email:[email protected]

http://diyisoft.blog.163.com/blog/static/1117807502007724101954460/

Boost_1_34_1 compiled in C++builder6 (copies all DLL files to the Windows system directory, so Lib files are copied to the Bcb6\lib directory)

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.