Opened 8 years ago

Last modified 8 months ago

#53460 assigned defect

boost: incompatible with _LIBCPP_DEBUG?

Reported by: akimd (Akim Demaille) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: michaelld (Michael Dickens), cooljeanius (Eric Gallager)
Port: boost

Description

Hi,

This might not be a bug, but since I found no page with a clear statement about this, I prefer reporting it anyway, so that at least people facing the same issue can find this ticket :)

Boost cannot be used with _LIBCPP_DEBUG enabled. I don't know if it would be possible for boost to deliver versions of the libraries that would have been compiled with it? Maybe that's exactly why some distros with -d versions of the libraries?

$ cat foo.cc
#include <boost/filesystem/path.hpp>

int
main ()
{
  boost::filesystem::path p;
  return 0;
}
$ clang++-mp-3.9 -std=c++1z  -D_LIBCPP_DEBUG=1 -isystem /opt/local/include   -L/opt/local/lib  foo.cc -lboost_filesystem-mt  -lboost_system-mt
Undefined symbols for architecture x86_64:
  "std::__1::__libcpp_db::__find_c_and_lock(void*) const", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long) in foo-28f256.o
  "std::__1::__libcpp_db::unlock() const", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long) in foo-28f256.o
  "std::__1::__libcpp_db::__insert_c(void*)", referenced from:
      boost::filesystem::path::path() in foo-28f256.o
  "std::__1::__libcpp_db::__invalidate_all(void*)", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__grow_by_and_replace(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, char const*) in foo-28f256.o
  "std::__1::__libcpp_db::__erase_c(void*)", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string() in foo-28f256.o
  "std::__1::__c_node::~__c_node()", referenced from:
      std::__1::_C_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::~_C_node() in foo-28f256.o
  "std::__1::__get_db()", referenced from:
      boost::filesystem::path::path() in foo-28f256.o
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string() in foo-28f256.o
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__grow_by_and_replace(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, char const*) in foo-28f256.o
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long) in foo-28f256.o
  "typeinfo for std::__1::__c_node", referenced from:
      typeinfo for std::__1::_C_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > in foo-28f256.o
  "vtable for std::__1::__c_node", referenced from:
      std::__1::_C_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::_C_node(void*, std::__1::__c_node*) in foo-28f256.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ clang++-mp-3.9 -std=c++1z  -isystem /opt/local/include   -L/opt/local/lib  foo.cc -lboost_filesystem-mt  -lboost_system-mt
$

Thanks!

Change History (5)

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Cc: michaelld added; ryandesign michaelld@… removed
Owner: set to ryandesign
Status: newassigned

comment:2 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

I don't know what you're talking about. Maybe you can ask the developers of boost for guidance.

comment:3 Changed 8 years ago by michaelld (Michael Dickens)

A quick internet search turns up this thread on Stackoverflow: http://stackoverflow.com/questions/15899937/is-it-possible-to-enable-libcpp-debug2-in-the-current-xcode-4-6-1-toolchain-on . Maybe try what they say? Seems like libc++ needs to be installed with debug code activated.

comment:4 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from ryandesign to michaelld

comment:5 Changed 8 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.