Modify

Ticket #7347 (closed Bugs: fixed)

Opened 20 months ago

Last modified 17 months ago

duplicate symbol while BOOST_ERROR_CODE_HEADER_ONLY is defined

Reported by: viboes Owned by: bemandawes
Milestone: To Be Determined Component: system
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc: viboes

Description

Even if BOOST_ERROR_CODE_HEADER_ONLY is not documented I wanted to report this defect.

When I define BOOST_ERROR_CODE_HEADER_ONLY building Boost.Thread I get the following error:

ld: duplicate symbol boost::system::system_category()     in ../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/future.o and ../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/pthread/thread.o for architecture x86_64
collect2: ld returned 1 exit status

    "g++" -dynamiclib -Wl,-single_module -install_name "libboost_thread.dylib"  -o "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/libboost_thread.dylib" "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/pthread/thread.o" "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/pthread/once.o" "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/future.o"      -headerpad_max_install_names -g

I guess that you need to declare the following functions inline.

    BOOST_SYSTEM_DECL const error_category &  system_category();
    BOOST_SYSTEM_DECL const error_category &  generic_category();

Attachments

7347.patch Download (4.6 KB) - added by viboes 20 months ago.
Simple patch that solves my issue. OK to commit?
7347_2.patch Download (1.9 KB) - added by viboes 20 months ago.
Needed to run the Boost.Thread test if BOOST_ERROR_CODE_HEADER_ONLY is defined

Change History

comment:1 Changed 20 months ago by viboes

  • Summary changed from BOOST_ERROR_CODE_HEADER_ONLY to duplicate symbol while BOOST_ERROR_CODE_HEADER_ONLY is defined

Changed 20 months ago by viboes

Simple patch that solves my issue. OK to commit?

comment:2 Changed 20 months ago by viboes

  • Cc viboes added

Changed 20 months ago by viboes

Needed to run the Boost.Thread test if BOOST_ERROR_CODE_HEADER_ONLY is defined

comment:3 Changed 20 months ago by viboes

The fact that the boost/../libs/system/src/error_code.cpp introduce too much symbols because of the using statements has as consequence.

test_7328.cpp: In function ‘void f()’:
test_7328.cpp:26: error: reference to ‘interrupted’ is ambiguous
test_7328.cpp:13: error: candidates are: bool interrupted
../../../boost/system/error_code.hpp:84: error:                 boost::system::errc::errc_t boost::system::errc::interrupted

The patch 7347_2 contribute to solve these issues.

Last edited 19 months ago by viboes (previous) (diff)

comment:4 Changed 17 months ago by viboes

  • Status changed from new to closed
  • Resolution set to fixed

It seems to me that these patches have been applied without closing the ticket.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.