Bug 697328

Summary: BOOST_IOSTREAMS_USE_DEPRECATED does not work
Product: [Fedora] Fedora Reporter: Rob Riggs <rob+redhat>
Component: boostAssignee: Benjamin Kosnik <bkoz>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: bkoz, denis.arnaud_fedora, mnewsome, pertusus, pmachata
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-22 14:58:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rob Riggs 2011-04-17 19:32:21 UTC
Description of problem:
BOOST_IOSTREAMS_USE_DEPRECATED appears to have not been defined when the boost libraries were built. This is defined by default when built with Jam according to this post:
http://permalink.gmane.org/gmane.comp.lib.boost.devel/208456

This prevents the use of this define by client code.  When building code that is compiled with this define, the linker reports undefined symbols:

undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(int, bool)'

Version-Release number of selected component (if applicable):
boost-1.44.0-7

How reproducible:
Always

Steps to Reproduce:
1. Use the following code as iostreams.C:
#define BOOST_IOSTREAMS_USE_DEPRECATED

#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>
#include <iostream>

int main()
{
    namespace io = boost::iostreams;
    io::file_descriptor_sink fds(1, true);
    io::filtering_ostream my_cout(fds);
    my_cout << "Hello, world." << std::endl;
    return EXIT_SUCCESS;
}

2. Build with "make LDFLAGS=-lboost_iostreams iostreams"
3. Note the build results.
  
Actual results:
g++ -g  -Wall -lboost_iostreams  iostreams.C   -o iostreams
/tmp/ccstARDG.o: In function `main':
/home/rob/iostreams.C:11: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(int, bool)'
collect2: ld returned 1 exit status
make: *** [iostreams] Error 1


Expected results:
A successful compile and link phase, resulting in an executable.

Additional info:
This bug does not exist in Fedora 15's boost-1.46.0 package so maybe it was fixed there and needs to be backported?

This apparently was introduced while trying to resolve 667294

Comment 1 Rob Riggs 2011-04-17 19:51:47 UTC
OK... I did not read through 667294 well enough.  I see that this was reported in that thread.  I have upgraded to boost-1.44.0-8.fc14 and all is well.

Please push to stable.  I've added my vote for that package.

Please close this report or merge into 667294.

Comment 2 Denis Arnaud 2011-04-22 14:58:36 UTC

*** This bug has been marked as a duplicate of bug 667294 ***