Problems with regex usage in boost

Source: Internet
Author: User

In the so file using the regex in the Boost library, if the following error occurs:

Undefined symbol: _ZN5BOOST9RE_DETAIL14VERIFY_OPTIONSEJNS_15REGEX_CONSTANTS12_MATCH_FLAGSE

Note the absence of a source file referencing the regex when generating the so file requires that the Regex's library be added to the makefile or compiled and then recompiled

If the following compile error occurs when recompiling

Relocation r_x86_64_32 against ' a local symbol ' can is used when making a shared object; Recompile with-fpic

Could not read Symbols:bad value

Note that the Regex library referenced at compile time does not use the-fpic option to download the corresponding project version of the Boost library, the latest boost library download address:

https://sourceforge.net/projects/boost/files/boost/1.60.0/

After the download is complete, unzip the boost library and enter the Libs/regex/build directory

Select the makefile file with the shared identity of the corresponding compiler, such as Gcc-shared.mak

Perform make-f Gcc-shared.mak

CD gcc/boost_regex-gcc-1_40_shared

AR cr target.a *.O

Then replace the TARGET.A with the original REGEX.A library.

If the original is so file, then replace the original regex.so with gcc/libboost_regex-gcc-1_40.so (this I did not try, my original is the static library)

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.