CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Boost library

  1. #1
    Join Date
    Feb 2012
    Posts
    5

    Boost library

    So, I have spent the last week looking googling and researching how to get a standalone copy of the regex part of the boost library to work in a project. This project will be compiled on other machines and I CANNOT have the user install it.

    Is there any way to do this?

    So far, I have built the regex part: I have both .so files and .a files built. The thing that I'm unsure of is that these were built with gcc and I am using/will be using g++.

    I have also finally got the bcp tool to work, and extracted the regex part and all of its dependencies.

    I can't get it to compile any way I try to work it. I need this to be in a folder "regex/" folder in my directory.

    I have used too many commands to paste them all, but the last I tried was this:

    g++ -g -pedantic -Wall -o doit test.C -Iregex/boost/ -Wl,-Lregex/libs/regex/build/gcc/ -static -lboost_regex-gcc-1_47

    I have also tried many variations of the above command. Such as using -lboost_regex and lots of other things. Is my whole problem because I'm using an .so built by GCC?

    The output of the above command was


    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
    (.text.__cxa_allocate_exception+0xb4): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
    (.text.__cxa_allocate_exception+0x111): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception':
    (.text.__cxa_free_exception+0x69): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception':
    (.text.__cxa_free_exception+0x84): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_dependent_exception':
    (.text.__cxa_allocate_dependent_exception+0x8c): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_dependent_exception':
    (.text.__cxa_allocate_dependent_exception+0xe8): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_free_dependent_exception':
    (.text.__cxa_free_dependent_exception+0x74): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_free_dependent_exception':
    (.text.__cxa_free_dependent_exception+0x8f): undefined reference to `pthread_mutex_unlock'
    regex/libs/regex/build/gcc//libboost_regex-gcc-1_47.a(static_mutex.o): In function `boost::scoped_static_mutex_lock::lock()':
    static_mutex.cpp.text+0x14): undefined reference to `pthread_mutex_lock'
    regex/libs/regex/build/gcc//libboost_regex-gcc-1_47.a(static_mutex.o): In function `boost::scoped_static_mutex_lock::unlock()':
    static_mutex.cpp.text+0x64): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(locale.o): In function `__gnu_cxx::__scoped_lock::~__scoped_lock()':
    (.text._ZN9__gnu_cxx13__scoped_lockD2Ev[_ZN9__gnu_cxx13__scoped_lockD5Ev]+0x16): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(locale.o): In function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned int)':
    (.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEj+0x41): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(locale.o): In function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned int)':
    (.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEj+0x73): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(locale_init.o): In function `std::locale::locale()':
    (.text._ZNSt6localeC2Ev+0x37): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(locale_init.o): In function `std::locale::locale()':
    (.text._ZNSt6localeC2Ev+0x53): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(locale_init.o): In function `std::locale::global(std::locale const&)':
    (.text._ZNSt6locale6globalERKS_+0x36): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(locale_init.o): In function `std::locale::global(std::locale const&)':
    (.text._ZNSt6locale6globalERKS_+0xb7): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
    (.text+0x1794): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_bases':
    (.text+0x17ab): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
    (.text+0x18ae): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__register_frame_info_table_bases':
    (.text+0x18c5): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
    (.text+0x198c): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `__deregister_frame_info_bases':
    (.text+0x19ff): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
    (.text+0x1aba): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc/i686-linux-gnu/4.6.1/libgcc_eh.a(unwind-dw2-fde-glibc.o): In function `_Unwind_Find_FDE':
    (.text+0x1b09): undefined reference to `pthread_mutex_unlock'
    collect2: ld returned 1 exit status

  2. #2
    Join Date
    Feb 2012
    Posts
    5

    Re: Boost library

    Disregard this post. I have decided that boost is too much of a pain in the *** to try and get to work. I am going with PCRE.

  3. #3
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Boost library

    Hmm... out of curiosity, but I notice that you appear to be using g++ 4.6.1. This probably has support for the C++11 regular expressions library, which is based on Boost.Regex, and which can be used by #include <regex>.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  4. #4
    Join Date
    Feb 2012
    Posts
    5

    Re: Boost library

    It might. I tried it once and it didn't really work for me. Is this the regex that is in td1? If so, I think that the computers I would be compiling it on might not be able to work with it, even though my computer can.

  5. #5
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Boost library

    I haven't used bcp, but building Boost isn't very difficult normally. Can I assume that bcp generates a Boost build tool tailored to the libraries you have? (Unfortunately, regex is one of the few Boost libraries that does require building.)

    Is the problem with compiling the bcp distribution, or with linking it in after compile?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured