libboost-date-time abi issue

Bug #1560009 reported by Heiko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Referencer
Invalid
Undecided
Unassigned

Bug Description

I am not able to link against libboost_date_time. Compiling the test program

#include "boost/date_time/gregorian/gregorian.hpp"
#include <iostream>
#include <string>

int main() {
  using namespace boost::gregorian;
  try {
    // The following date is in ISO 8601 extended format (CCYY-MM-DD)
    std::string s("2001-10-9"); //2001-October-09
    date d(from_simple_string(s));
    std::cout << to_simple_string(d) << std::endl;
  }
  catch(std::exception& e) {
    std::cout << " Exception: " << e.what() << std::endl;
  }
  return 0;
}

with »g++ -o test test.cc -lboost_date_time« yields

/tmp/ccwYYS48.o: In function `unsigned short boost::date_time::month_str_to_ushort<boost::gregorian::greg_month>(std::string const&)':
test.cc:(.text._ZN5boost9date_time19month_str_to_ushortINS_9gregorian10greg_monthEEEtRKSs[_ZN5boost9date_time19month_str_to_ushortINS_9gregorian10greg_monthEEEtRKSs]+0xab): undefined reference to `boost::gregorian::greg_month::get_month_map_ptr()'
collect2: error: ld returned 1 exit status

I figured out that the reason for this error is due to the static member function get_month_map_ptr in
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.58.0 has the abi tag cxx11. I think, this function should not have this tag. I speculate it was added automatically by the compiler while compiling the library because of the function's return value. As a temporary fix I added »__attribute((abi_tag("cxx11")))« in the file /usr/include/boost/date_time/gregorian/greg_month.hpp to the declaration of the static member function get_month_map_ptr.

Revision history for this message
Mads Chr. Olesen (shiyee) wrote :

I think this bug is mislabeled, I cannot see what it has to do with Referencer :-)

Changed in referencer:
status: New → Invalid
Revision history for this message
Heiko (heiko-bauke-snafu) wrote :

Oops, got the wrong project. Sorry for the noise.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.