Subject: [Boost-bugs] [Boost C++ Libraries] #6797: Undefined references for program_options library with mingw64.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-16 08:43:50
#6797: Undefined references for program_options library with mingw64.
------------------------------+---------------------------------------------
Reporter: tasptz@⦠| Owner: vladimir_prus
Type: Support Requests | Status: new
Milestone: To Be Determined | Component: program_options
Version: Boost 1.49.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
I compiled a shared version of boost program_options with mingw64. When I
try to link against it I get:
{{{
Linking CXX executable ..\..\..\binary\abc.exe
CMakeFiles\abc.dir/objects.a(test.cpp.obj):test.cpp:(.text+0x65bf):
undefined reference to
`boost::program_options::detail::common_config_file_iterator::c
ommon_config_file_iterator(std::set<std::string, std::less<std::string>,
std::allocator<std::string> > const&, bool)'
CMakeFiles\abc.dir/objects.a(test.cpp.obj):test.cpp:(.text+0x6672):
undefined reference to
`boost::program_options::detail::common_config_file_iterator::g
et()'
CMakeFiles\abc.dir/objects.a(test.cpp.obj):test.cpp:(.text+0x7871):
undefined reference to
`boost::program_options::detail::common_config_file_iterator::g
et()'
collect2: ld returned 1 exit status
}}}
I use cmake for my project and everything works fine under linux.
nm gives the following output:
{{{
$ nm libboost_program_options.dll | grep common_config_file_iterator
000000006e1a62c0 d
.data$_ZTIN5boost12eof_iteratorINS_15program_options6detail27common_config_file_iteratorENS1_12basic_optionIcEEEE
000000006e1a62e0 d
.data$_ZTIN5boost15iterator_facadeINS_15program_options6detail27common_config_file_iteratorEKNS1_12basic_optionIcEENS_21forward_traversal_tag
ERS6_xEE
000000006e1a6660 d
.data$_ZTIN5boost15program_options6detail27common_config_file_iteratorE
000000006e1a96a0 d
.data$_ZTVN5boost15program_options6detail27common_config_file_iteratorE
000000006e1b578c p
.pdata$_ZN5boost15program_options6detail27common_config_file_iterator7getlineERSs
000000006e1b58d0 p
.pdata$_ZN5boost15program_options6detail27common_config_file_iteratorD0Ev
000000006e1b58c4 p
.pdata$_ZN5boost15program_options6detail27common_config_file_iteratorD1Ev
000000006e1b5d38 p
.pdata$_ZN5boost15program_options6detail27common_config_file_iteratorD2Ev
000000006e1b18e0 r
.rdata$_ZTSN5boost12eof_iteratorINS_15program_options6detail27common_config_file_iteratorENS1_12basic_optionIcEEEE
000000006e1b1960 r
.rdata$_ZTSN5boost15iterator_facadeINS_15program_options6detail27common_config_file_iteratorEKNS1_12basic_optionIcEENS_21forward_traversal_ta
gERS6_xEE
000000006e1b20e0 r
.rdata$_ZTSN5boost15program_options6detail27common_config_file_iteratorE
000000006e108c20 t
.text$_ZN5boost15program_options6detail27common_config_file_iterator7getlineERSs
000000006e108c30 t
.text$_ZN5boost15program_options6detail27common_config_file_iteratorD0Ev
000000006e108e00 t
.text$_ZN5boost15program_options6detail27common_config_file_iteratorD1Ev
000000006e108fc0 t
.text$_ZN5boost15program_options6detail27common_config_file_iteratorD2Ev
000000006e1be600 r
.xdata$_ZN5boost15program_options6detail27common_config_file_iterator7getlineERSs
000000006e1be74c r
.xdata$_ZN5boost15program_options6detail27common_config_file_iteratorD0Ev
000000006e1be740 r
.xdata$_ZN5boost15program_options6detail27common_config_file_iteratorD1Ev
000000006e1beadc r
.xdata$_ZN5boost15program_options6detail27common_config_file_iteratorD2Ev
000000006e198fe0 t
_GLOBAL__sub_I__ZN5boost15program_options6detail27common_config_file_iteratorC2ERKSt3setISsSt4lessISsESaISsEEb
000000006e0cd800 T
_ZN5boost15program_options6detail27common_config_file_iterator10add_optionEPKc
000000006e0cde20 T
_ZN5boost15program_options6detail27common_config_file_iterator3getEv
U
_ZN5boost15program_options6detail27common_config_file_iterator7getlineERSs
000000006e108c20 T
_ZN5boost15program_options6detail27common_config_file_iterator7getlineERSs
000000006e0ceda0 T
_ZN5boost15program_options6detail27common_config_file_iteratorC1ERKSt3setISsSt4lessISsESaISsEEb
000000006e0da700 t
_ZN5boost15program_options6detail27common_config_file_iteratorC2ERKS2_.constprop.235
000000006e0ceda0 T
_ZN5boost15program_options6detail27common_config_file_iteratorC2ERKSt3setISsSt4lessISsESaISsEEb
000000006e108c30 T
_ZN5boost15program_options6detail27common_config_file_iteratorD0Ev
U
_ZN5boost15program_options6detail27common_config_file_iteratorD0Ev
U
_ZN5boost15program_options6detail27common_config_file_iteratorD1Ev
000000006e108e00 T
_ZN5boost15program_options6detail27common_config_file_iteratorD1Ev
000000006e108fc0 T
_ZN5boost15program_options6detail27common_config_file_iteratorD2Ev
000000006e0cd660 T
_ZNK5boost15program_options6detail27common_config_file_iterator14allowed_optionERKSs
000000006e1a62c0 D
_ZTIN5boost12eof_iteratorINS_15program_options6detail27common_config_file_iteratorENS1_12basic_optionIcEEEE
000000006e1a62e0 D
_ZTIN5boost15iterator_facadeINS_15program_options6detail27common_config_file_iteratorEKNS1_12basic_optionIcEENS_21forward_traversal_tagERS6_x
EE
000000006e1a6660 D
_ZTIN5boost15program_options6detail27common_config_file_iteratorE
000000006e1b18e0 R
_ZTSN5boost12eof_iteratorINS_15program_options6detail27common_config_file_iteratorENS1_12basic_optionIcEEEE
000000006e1b1960 R
_ZTSN5boost15iterator_facadeINS_15program_options6detail27common_config_file_iteratorEKNS1_12basic_optionIcEENS_21forward_traversal_tagERS6_x
EE
000000006e1b20e0 R
_ZTSN5boost15program_options6detail27common_config_file_iteratorE
000000006e1a96a0 D
_ZTVN5boost15program_options6detail27common_config_file_iteratorE
}}}
The command I use to build boost is:
{{{
b2 --toolset=gcc variant=release address-model=64 threading=multi
optimization=speed link=shared runtime-link=shared
cxxflags='-DBOOST_USE_WINDOWS_H -std=gnu++0x -march=core2 -mtune=core2
-msse -msse2 -mssse3 -msse4' --with-thread --with-dat
e_time --with-filesystem --with-program_options --prefix=c:/temp/boost
install
}}}
I attach a minimal cmake project (I used Boost 1.48.0 there, but it makes
no difference).
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6797> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC