Modify

Opened 5 years ago

Closed 5 years ago

#7347 closed Bugs (fixed)

duplicate symbol while BOOST_ERROR_CODE_HEADER_ONLY is defined

Reported by: viboes Owned by: Beman Dawes
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 (2)

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

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by viboes

Summary: BOOST_ERROR_CODE_HEADER_ONLYduplicate symbol while BOOST_ERROR_CODE_HEADER_ONLY is defined

Changed 5 years ago by viboes

Attachment: 7347.patch added

Simple patch that solves my issue. OK to commit?

comment:2 Changed 5 years ago by viboes

Cc: viboes added

Changed 5 years ago by viboes

Attachment: 7347_2.patch added

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

comment:3 Changed 5 years 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 5 years ago by viboes (previous) (diff)

comment:4 Changed 5 years ago by viboes

Resolution: fixed
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Beman Dawes.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.