I've been trying to get otiai10/gosseract (Go package for Tesseract C++ library) working on Windows without success. As a requirement, gosseract requires the installation of "tesseract-ocr, including library and headers".
The Tesseract Windows compiling documentation mentions the usage of SW and Vcpkg, which to my understanding relies on MSVC and is hence not compatible with Go.
The documentation also mentions the existence of Cygwin packages. I have tried leveraging them by installing tesseract-ocr (5.2.0-1), tesseract-ocr-devel (5.2.0-1), tesseract-ocr-eng (5.00-1) as well as mingw64-x86_64-gcc-g++ and mingw64-x86_64-gcc-core after which I defined the following environment variables:
CGO_CFLAGS=-IC:\cygwin64\usr\include
CGO_CPPFLAGS=-IC:\cygwin64\usr\include
CGO_LDFLAGS=-LC:\cygwin64\lib
PATH=C:\cygwin64\bin;...
CC=C:\cygwin64\bin\x86_64-w64-mingw32-gcc.exe
CXX=C:\cygwin64\bin\x86_64-w64-mingw32-g++.exe
However, trying to compile (through GoLand) an example project (otiai10/ocrserver) still results in linker errors:
GOROOT=C:\Users\REDACTED\go\go1.18rc1 #gosetup
GOPATH=C:\Users\REDACTED\go #gosetup
C:\Users\REDACTED\go\go1.18rc1\bin\go.exe build -o C:\Users\REDACTED\AppData\Local\Temp\GoLand\___go_build_github_com_otiai10_ocrserver.exe github.com/otiai10/ocrserver #gosetup
# github.com/otiai10/gosseract/v2
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: $WORK\b133\_x003.o: in function `tesseract::TessBaseAPI::Init(char const*, char const*)':
/cygdrive/c/Users/REDACTED/go/pkg/mod/github.com/otiai10/gosseract/v2#v2.3.1/C:/cygwin64/usr/include/tesseract/baseapi.h:215: undefined reference to `tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, bool)'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: /cygdrive/c/Users/REDACTED/go/pkg/mod/github.com/otiai10/gosseract/v2#v2.3.1/C:/cygwin64/usr/include/tesseract/baseapi.h:215: undefined reference to `tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, bool)'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: /cygdrive/c/Users/REDACTED/go/pkg/mod/github.com/otiai10/gosseract/v2#v2.3.1/C:/cygwin64/usr/include/tesseract/baseapi.h:215: undefined reference to `tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*, bool)'
collect2: error: ld returned 1 exit status
How can one get "tesseract-ocr, including library and headers" properly set up on a Windows machine for CGO compatibility?
> go version
go version go1.17 windows/amd64
> C:\cygwin64\bin\x86_64-w64-mingw32-gcc.exe --version
x86_64-w64-mingw32-gcc (GCC) 11.3.0
> C:\cygwin64\bin\x86_64-w64-mingw32-g++.exe --version
x86_64-w64-mingw32-g++ (GCC) 11.3.0
> C:\cygwin64\bin\x86_64-w64-mingw32-ld.exe --version
GNU ld (GNU Binutils) 2.38
Related
I have tried to link boost in my CMakeList file by
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_NO_SYSTEM_PATHS TRUE)
set(Boost_INCLUDE_DIR /user/software/boost/boost-1.69-x86_64-cc7/include)
set(Boost_LIBRARY_DIR /user/software/boost/boost-1.69-x86_64-cc7/lib)
find_package(Boost 1.54 REQUIRED COMPONENTS filesystem program_options system)
and i get the following warning when doing cmake
CMake Warning at /user/software/cmake/cmake-3.7.1-x86_64-cc7/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
Imported targets not available for Boost version 106900
Call Stack (most recent call first):
/user/software/cmake/cmake-3.7.1-x86_64-cc7/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
/user/software/cmake/cmake-3.7.1-x86_64-cc7/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
util/src/CMakeLists.txt:21 (find_package)
So when i do the make command i get the error
CMakeFiles/checkFile.dir/checkFile.cpp.o: In function `boost::program_options::typed_value<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, char>::name() const':
checkFile.cpp:(.text._ZNK5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcE4nameEv[_ZNK5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcE4nameEv]+0x25): undefined reference to `boost::program_options::arg[abi:cxx11]'
CMakeFiles/checkFile.dir/checkFile.cpp.o: In function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
checkFile.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x112): undefined reference to `boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
checkFile.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x187): undefined reference to `boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'
CMakeFiles/checkFile.dir/checkFile.cpp.o: In function `main':
checkFile.cpp:(.text.startup+0x63): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
checkFile.cpp:(.text.startup+0x222): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
CMakeFiles/checkFile.dir/checkFile.cpp.o: In function `void boost::program_options::validate<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*, int) [clone .constprop.475]':
checkFile.cpp:(.text._ZN5boost15program_options8validateINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEEvRNS_3anyERKSt6vectorINS3_IT0_S4_ISB_ESaISB_EEESaISE_EEPSA_IT_SaISJ_EEi.constprop.475[_ZNK5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcE6xparseERNS_3anyERKSA_]+0xc9): undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)'
checkFile.cpp:(.text._ZN5boost15program_options8validateINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEEvRNS_3anyERKSt6vectorINS3_IT0_S4_ISB_ESaISB_EEESaISE_EEPSA_IT_SaISJ_EEi.constprop.475[_ZNK5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcE6xparseERNS_3anyERKSA_]+0x4b4): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/checkFile.dir/checkFile.cpp.o:(.data.rel.ro._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
CMakeFiles/checkFile.dir/checkFile.cpp.o:(.data.rel.ro._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
CMakeFiles/checkFile.dir/checkFile.cpp.o:(.data.rel.ro._ZTCN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE0_NS_16exception_detail10clone_implINS4_19error_info_injectorIS2_EEEE[_ZTVN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
CMakeFiles/checkFile.dir/checkFile.cpp.o:(.data.rel.ro._ZTVN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE[_ZTVN5boost10wrapexceptINS_15program_options20invalid_option_valueEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
CMakeFiles/checkFile.dir/checkFile.cpp.o:(.data.rel.ro._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
CMakeFiles/checkFile.dir/checkFile.cpp.o:(.data.rel.ro._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): more undefined references to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' follow
CMakeFiles/checkFile.dir/checkFile.cpp.o:(.data.rel.ro._ZTVN5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcEE[_ZTVN5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
Any help please would be greatly appreciated
Try compiling your code while defining macro _GLIBCXX_USE_CXX11_ABI=0, e.g.:
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
If you get linker errors about undefined references to symbols that involve types in the std::__cxx11 namespace or the tag [abi:cxx11] then it probably indicates that you are trying to link together object files that were compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro. This commonly happens when linking to a third-party library that was compiled with an older version of GCC. If the third-party library cannot be rebuilt with the new ABI then you will need to recompile your code with the old ABI.
I am having errors while compiling my C++ code on the server.
So on this particular server the standard g++ installed is version 4.4.6, which I cannot use for my program since I need -std=c++14.
So I use a different version, which is installed in the home directory of another user, which is a version 7.1, called with command g++_71.
Know all the files compile except one class where I make use of the boost program_options.
When just linking to -lboost_program_options, it wouldn't work, because it would link to an old version of boost, that does not support the functionalities I was using, and also was compiled with the 4.4.6 gcc.
Therefore I downloaded boost version 1.66.0 and installed it in my home directory in a folder I named boost. I made sure that boost was installed with the correct toolset g++_71, even if this should not change a thing for a header-only library which program_options is.
Now I still get linker errors :
objlinux/src/Utilities/Options/OptionsParser.o: In function `OptionsParser::parseOptionsFromCommandline(int, char**)':
OptionsParser.cpp:(.text+0x28c2): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
OptionsParser.cpp:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i]+0x21): undefined reference to `_ZN5boost15program_options16validation_error12get_templateB5cxx11ENS1_6kind_tE'
OptionsParser.cpp:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i]+0x3b): undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const':
OptionsParser.cpp:(.text._ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE6xparseERNS_3anyERKSt6vectorIS7_SaIS7_EE[_ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE6xparseERNS_3anyERKSt6vectorIS7_SaIS7_EE]+0x17): undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::typed_value<bool, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const':
OptionsParser.cpp:(.text._ZNK5boost15program_options11typed_valueIbcE6xparseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EE[_ZNK5boost15program_options11typed_valueIbcE6xparseERNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EE]+0x17): undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool*, int)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::error_with_option_name::~error_with_option_name()':
OptionsParser.cpp:(.text._ZN5boost15program_options22error_with_option_nameD2Ev[_ZN5boost15program_options22error_with_option_nameD5Ev]+0x17): undefined reference to `vtable for boost::program_options::error_with_option_name'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::error_with_option_name::error_with_option_name(boost::program_options::error_with_option_name const&)':
OptionsParser.cpp:(.text._ZN5boost15program_options22error_with_option_nameC2ERKS1_[_ZN5boost15program_options22error_with_option_nameC5ERKS1_]+0x22): undefined reference to `vtable for boost::program_options::error_with_option_name'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::basic_command_line_parser<char>::run()':
OptionsParser.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcE3runEv[_ZN5boost15program_options25basic_command_line_parserIcE3runEv]+0x1b): undefined reference to `boost::program_options::detail::cmdline::get_canonical_option_prefix()'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
OptionsParser.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x14d): undefined reference to `boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
OptionsParser.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x1e9): undefined reference to `boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `boost::program_options::basic_parsed_options<char> boost::program_options::parse_command_line<char>(int, char const* const*, boost::program_options::options_description const&, int, boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)':
OptionsParser.cpp:(.text._ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESJ_ERKSJ_EE[_ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESJ_ERKSJ_EE]+0xaf): undefined reference to `boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `_ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE4nameB5cxx11Ev':
OptionsParser.cpp:(.text._ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE4nameEv[_ZNK5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcE4nameEv]+0x32): undefined reference to `_ZN5boost15program_options3argB5cxx11E'
objlinux/src/Utilities/Options/OptionsParser.o: In function `_ZNK5boost15program_options11typed_valueIlcE4nameB5cxx11Ev':
OptionsParser.cpp:(.text._ZNK5boost15program_options11typed_valueIlcE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueIlcE4nameB5cxx11Ev]+0x32): undefined reference to `_ZN5boost15program_options3argB5cxx11E'
objlinux/src/Utilities/Options/OptionsParser.o: In function `_ZNK5boost15program_options11typed_valueIbcE4nameB5cxx11Ev':
OptionsParser.cpp:(.text._ZNK5boost15program_options11typed_valueIbcE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueIbcE4nameB5cxx11Ev]+0x32): undefined reference to `_ZN5boost15program_options3argB5cxx11E'
objlinux/src/Utilities/Options/OptionsParser.o: In function `_ZNK5boost15program_options11typed_valueIdcE4nameB5cxx11Ev':
OptionsParser.cpp:(.text._ZNK5boost15program_options11typed_valueIdcE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueIdcE4nameB5cxx11Ev]+0x32): undefined reference to `_ZN5boost15program_options3argB5cxx11E'
objlinux/src/Utilities/Options/OptionsParser.o: In function `_ZNK5boost15program_options11typed_valueIicE4nameB5cxx11Ev':
OptionsParser.cpp:(.text._ZNK5boost15program_options11typed_valueIicE4nameB5cxx11Ev[_ZNK5boost15program_options11typed_valueIicE4nameB5cxx11Ev]+0x32): undefined reference to `_ZN5boost15program_options3argB5cxx11E'
objlinux/src/Utilities/Options/OptionsParser.o: In function `void boost::program_options::validate<double, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, double*, long)':
OptionsParser.cpp:(.text._ZN5boost15program_options8validateIdcEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l[_ZN5boost15program_options8validateIdcEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l]+0x4dd): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `void boost::program_options::validate<long, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, long*, long)':
OptionsParser.cpp:(.text._ZN5boost15program_options8validateIlcEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l[_ZN5boost15program_options8validateIlcEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l]+0x264): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
objlinux/src/Utilities/Options/OptionsParser.o: In function `void boost::program_options::validate<int, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, int*, long)':
OptionsParser.cpp:(.text._ZN5boost15program_options8validateIicEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l[_ZN5boost15program_options8validateIicEEvRNS_3anyERKSt6vectorINSt7__cxx1112basic_stringIT0_St11char_traitsIS7_ESaIS7_EEESaISB_EEPT_l]+0x233): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x28): undefined reference to `boost::program_options::error_with_option_name::what() const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x28): undefined reference to `boost::program_options::error_with_option_name::what() const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTIN5boost15program_options16validation_errorE[_ZTIN5boost15program_options16validation_errorE]+0x10): undefined reference to `typeinfo for boost::program_options::error_with_option_name'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE[_ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options11typed_valueIicEE[_ZTVN5boost15program_options11typed_valueIicEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options11typed_valueIlcEE[_ZTVN5boost15program_options11typed_valueIlcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options11typed_valueIdcEE[_ZTVN5boost15program_options11typed_valueIdcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
objlinux/src/Utilities/Options/OptionsParser.o:(.rodata._ZTVN5boost15program_options11typed_valueIbcEE[_ZTVN5boost15program_options11typed_valueIbcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
collect2: error: ld returned 1 exit status
make: *** [ACOPPD] Error 1
I tried different techniques to resolve this error:
I tried to just do the recommended include : #include "boost/program_options.hpp" and -I /home/mkupper/boost/boost_1_66_0 in the Makefile as it is recommended by the boost documentation for header-only library, which program_options is.
I tried to include with the full path : #include "/home/mkupper/boost/boost_1_66_0/boost/program_options.hpp"
I tried to include -I /home/mkupper/boost/boost_1_66_0 -L /home/mkupper/boost/boost_1_66_0/libs into the linker and compiler flags to.
I tried to include -lboost_program_options in addition to the other includes.
I tried if the -lstdc++ would change anything.
Nothing changes the linker errors, I am helpless !
Here my current Makefile:
CFLAGS := -std=c++14 -Wall -Ofast -march=native -Wunused-parameter
LDFLAGS := -lstdc++ -I /home/mkupper/boost/boost_1_66_0 -L /home/mkupper/boost/boost_1_66_0/libs
BUILDDIR := objlinux
SOURCEDIR := src
HEADERDIR := include
SRCEXT := cpp
OBJEXT := o
SOURCES := $(shell find $(SOURCEDIR) -name '*.$(SRCEXT)')
OBJECTS := $(addprefix $(BUILDDIR)/,$(SOURCES:%.$(SRCEXT)=%.$(OBJEXT)))
BINARY := ./ACOPPD
ECHO := echo
RM := rm -rf
MKDIR := mkdir
.PHONY: all clean
all: $(BINARY)
$(BINARY): $(OBJECTS)
g++_71 $(CFLAGS) $(OBJECTS) -o $(BINARY) $(LDFLAGS)
$(BUILDDIR)/%.$(OBJEXT): %.$(SRCEXT)
g++_71 $(CFLAGS) $(LDFLAGS) -I $(HEADERDIR) -I $(dir $<) -c $< -o $#
clean:
$(RM) $(BINARY) $(OBJECTS)
distclean: clean
The -I option indicates where the compiler needs to find the include files, therefore it belongs to the compiler flags CFLAGS.
The -L option indicates where the linker needs to find the library files, and the -l option tells the linker which libraries to include, therefore both should go into LDFLAGS.
With these said, you have missed the -lboost_program_options flag in LDFLAGS. As a result the linker will not incorporate the boost_program_options library. -L alone here is meaningless.
Bottom lines - try these:
CFLAGS := -std=c++14 -Wall -Ofast -march=native -Wunused-parameter -I/home/mkupper/boost/boost_1_66_0
LDFLAGS := -L/home/mkupper/boost/boost_1_66_0/libs -lstdc++ -lboost_program_options
Windows 10 Anniversary Update came out a couple of months ago, and I'm trying out the new "Bash on Ubuntu on Windows" feature.
I used it to compile some of my previous projects (finished on a normal Ubuntu machine), and while most of them were successfully built, a few of them received multiple undefined reference to ... (std::__cxx11::... errors when building the entire project (after compilations on separate files are done without errors).
I tried switching to g++-4.8, g++-4.9, g++-5.4 and g++-6.2 and all of them came down to the same result. I also tried adding compiler option -D_GLIBCXX_USE_CXX11_ABI=0/-D_GLIBCXX_USE_CXX11_ABI=1 in Makefile and still ended up with the same errors.
Here are parts of these error messages:
> building cirTest...
../../lib/libcmd.a(cmdCommon.o): In function `HistoryCmd::exec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
cmdCommon.cpp:(.text+0xb3): undefined reference to `myStr2Int(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int&)'
../../lib/libcmd.a(cmdCommon.o): In function `HelpCmd::exec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
cmdCommon.cpp:(.text+0x91d): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
../../lib/libcmd.a(cmdCommon.o): In function `UsageCmd::exec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
cmdCommon.cpp:(.text+0xd5c): undefined reference to `myStrNCmp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
cmdCommon.cpp:(.text+0xdb9): undefined reference to `myStrNCmp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
cmdCommon.cpp:(.text+0xe68): undefined reference to `myStrNCmp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
../../lib/libcmd.a(cmdCommon.o): In function `QuitCmd::exec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
cmdCommon.cpp:(.text+0x1190): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_not_of(char, unsigned long) const'
cmdCommon.cpp:(.text+0x126f): undefined reference to `myStrNCmp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
cmdCommon.cpp:(.text+0x1320): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Since most of my projects did build successfully, I wonder if it's possible to solve the problem by toggling some settings without jumping to the conclusion that this is simply a result of "Bash on Ubuntu on Windows" still being a "beta" feature.
I am trying to get QL working on Debian, but failing at the last step. I have downloaded the source, built and installed the library (“make”, “make install”) without any errors, but my application that uses the QuantLib library throws up some linker errors related to a single class (QuantLib::Error):
build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Observable::notifyObservers()':
/usr/local/include/ql/patterns/observable.hpp:143: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::operator+(QuantLib::Array const&, QuantLib::Array const&)':
/usr/local/include/ql/math/array.hpp:499: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::DiscretizedOption::reset(unsigned long)':
/usr/local/include/ql/discretizedasset.hpp:222: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Instrument::setupArguments(QuantLib::PricingEngine::arguments*) const':
/usr/local/include/ql/instrument.hpp:145: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/Debug/GNU-Linux-x86/PricingEngine.o: In function `QuantLib::Instrument::performCalculations() const':
/usr/local/include/ql/instrument.hpp:164: undefined reference to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/Debug/GNU-Linux-x86/PricingEngine.o:/usr/local/include/ql/instrument.hpp:176: more undefined references to `QuantLib::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' follow
I’m on Debian 8, amd64, compiled both the library and application with g++-5.
Does anyone have any ideas?
EDIT: Here's the command line:
g++ -o dist/Debug/GNU-Linux-x86/hub build/Debug/GNU-Linux-x86/Calculations.o build/Debug/GNU-Linux-x86/Client.o build/Debug/GNU-Linux-x86/Connection.o build/Debug/GNU-Linux-x86/DataStore.o build/Debug/GNU-Linux-x86/Hub.o build/Debug/GNU-Linux-x86/Instruments.o build/Debug/GNU-Linux-x86/Parameters.o build/Debug/GNU-Linux-x86/PricingEngine.o build/Debug/GNU-Linux-x86/Server.o build/Debug/GNU-Linux-x86/main.o build/Debug/GNU-Linux-x86/stdafx.o -L/usr/lib/x86_64-linux-gnu -L/usr/lib ../Core/dist/Debug/GNU-Linux-x86/libcore.a -lQuantLib /usr/lib/x86_64-linux-gnu/libboost_log.a /usr/lib/x86_64-linux-gnu/libboost_log_setup.a -lboost_system -lzmq -lboost_filesystem -lpq -lboost_unit_test_framework -lboost_thread -lpgm -lldap -lssl -lcrypto -lsodium -ldl -pthread
It is likely that PricingEngine.o is compiled with (default) value of _GLIBCXX_USE_CXX11_ABI=1, while QuantLib is compiled with _GLIBCXX_USE_CXX11_ABI=0.
See also example at the end of this answer.
I'm trying to compile a C++ program under Ubuntu 11.10 using boost 1.42 installed from the repository (I also tried building boost myself, but the result is the same as with the repo-boost). The source files compile but the linker gives errors... I tried for hours but couldn't find a solution to this, maybe someone can help me...
Here's the target from the Makefile
CXX = /usr/bin/g++
LDFLAGS = -L. \
-Lpath/to/libMy_Lib.a
CFLAGS = -I. \
-Wall \
-g \
-O0
OBJECTS = obj1.o obj2.o
%.o: %.cpp
$(CXX) -c $*.cpp -o $# \
-Wno-deprecated \
$(CFLAGS)
all: program
program: $(OBJECTS)
$(CXX) $^ \
$(LDFLAGS) \
-o myProg \
-lboost_regex \
-lboost_filesystem \
-lboost_date_time \
-lboost_system \
-lboost_thread \
-lMy_Lib
libMy_Lib.a is a library which also uses boost (I had no problems compiling it on the same system). All the libs look ok in /usr/lib...
Here is the output ld generates (I used make 2> output) http://ubuntuone.com/6QlU7AUZGgLGIu7sHbvDHm
Maybe the order of the libraries isn't correct (I know boost_filesystem depends on boost_system, but I'm not sure about the rest) or I forgot to specify some additional libs on which my program needs to link to...
This really buggs me and I feel like I'm blind to not see it...
Those error messages are impressive:
../../DIAG_DECODER//libDecoder_Element.a(BaseElements_Group.o): In function `bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)':
BaseElements_Group.cpp:(.text._ZN5boost11regex_matchIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS5_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SD_RNS_13match_resultsISD_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsE[bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)]+0x4c):
undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()'
I added a newline before the 'undefined reference'...
I think you should probably list your library, which uses Boost functions, before any of the Boost libraries.