On 20/09/15 17:10, Guillaume Munch wrote:
Le 20/09/2015 14:40, pdv a écrit :
Hi,

As of commit 9b7ccbf (the introduction of class InsetCaptionable)
building LyX2.2 fails on OS X (with XCode and with autotools).

This is the error message:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2075:40:

Constructor for
'std::__1::__libcpp_compressed_pair_imp<std::__1::allocator<const
lyx::Toc>, const lyx::Toc, 1>' must explicitly initialize the const
member '__second_'
.../lyx-22-qt5/src/frontends/qt4/TocModel.cpp:14:10: In file included
from .../lyx-22-qt5/src/frontends/qt4/TocModel.cpp:14:
.../lyx-22-qt5/src/frontends/qt4/TocModel.h:15:10: In file included from
.../lyx-22-qt5-cmake-xcode/src/frontends/qt4/../../../../lyx-22-qt5/src/frontends/qt4/TocModel.h:15:


.../lyx-22-qt5/src/support/shared_ptr.h:17:10: In file included from
.../lyx-22-qt5/src/support/shared_ptr.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2345:11:

In instantiation of member function
'std::__1::__libcpp_compressed_pair_imp<std::__1::allocator<const
lyx::Toc>, const lyx::Toc, 1>::__libcpp_compressed_pair_imp' requested
here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3727:12:

In instantiation of member function
'std::__1::__compressed_pair<std::__1::allocator<const lyx::Toc>, const
lyx::Toc>::__compressed_pair' requested here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4308:26:

In instantiation of member function
'std::__1::__shared_ptr_emplace<const lyx::Toc,
std::__1::allocator<const lyx::Toc> >::__shared_ptr_emplace' requested
here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4672:29:

In instantiation of function template specialization
'std::__1::shared_ptr<const lyx::Toc>::make_shared<>' requested here
.../lyx-22-qt5/src/frontends/qt4/TocModel.cpp:84:28: In instantiation of
function template specialization 'std::__1::make_shared<const lyx::Toc>'
requested here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2063:9:

'__second_' declared here

------------

Apparently there is a bug in c++/v1/memory as reported here
(http://lists.llvm.org/pipermail/llvm-bugs/2015-July/040892.html)

After patching c++/v1/memory the compile error goes away but the link
fails with undefined symbols.

Undefined symbols for architecture x86_64:
   "lyx::InsetCaptionable::updateBuffer(lyx::ParIterator const&,
lyx::UpdateType)", referenced from:
       vtable for lyx::InsetFloat in libinsets.a(InsetFloat.o)
       vtable for lyx::InsetListings in libinsets.a(InsetListings.o)
       lyx::InsetWrap::updateBuffer(lyx::ParIterator const&,
lyx::UpdateType) in libinsets.a(InsetWrap.o)
   "lyx::InsetCaptionable::setCaptionType(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)",
referenced from:
       lyx::InsetFloat::setCaptionType(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in
libinsets.a(InsetFloat.o)
       vtable for lyx::InsetListings in libinsets.a(InsetListings.o)
       lyx::InsetWrap::setCaptionType(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in
libinsets.a(InsetWrap.o)
   "lyx::InsetCaptionable::insetAllowed(lyx::InsetCode) const",
referenced from:
       lyx::InsetFloat::insetAllowed(lyx::InsetCode) const in
libinsets.a(InsetFloat.o)
       lyx::InsetWrap::insetAllowed(lyx::InsetCode) const in
libinsets.a(InsetWrap.o)
   "lyx::InsetCaptionable::addToToc(lyx::DocIterator const&, bool)
const", referenced from:
       vtable for lyx::InsetFloat in libinsets.a(InsetFloat.o)
       vtable for lyx::InsetListings in libinsets.a(InsetListings.o)
       vtable for lyx::InsetWrap in libinsets.a(InsetWrap.o)
   "lyx::InsetCaptionable::floatName(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) const",
referenced from:
       lyx::InsetFloat::setCaptionType(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in
libinsets.a(InsetFloat.o)
       lyx::InsetFloat::setNewLabel() in libinsets.a(InsetFloat.o)
       lyx::InsetFloat::plaintext(std::__1::basic_ostringstream<wchar_t,
std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&,
lyx::OutputParams const&, unsigned long) const in
libinsets.a(InsetFloat.o)
       lyx::InsetWrap::setCaptionType(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in
libinsets.a(InsetWrap.o)
       lyx::InsetWrap::plaintext(std::__1::basic_ostringstream<wchar_t,
std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&,
lyx::OutputParams const&, unsigned long) const in
libinsets.a(InsetWrap.o)
   "typeinfo for lyx::InsetCaptionable", referenced from:
       typeinfo for lyx::InsetFloat in libinsets.a(InsetFloat.o)
       typeinfo for lyx::InsetListings in libinsets.a(InsetListings.o)
       typeinfo for lyx::InsetWrap in libinsets.a(InsetWrap.o)
   "vtable for lyx::InsetCaptionable", referenced from:
       lyx::InsetCaptionable::InsetCaptionable(lyx::Buffer*) in
libinsets.a(InsetFloat.o)
       lyx::InsetCaptionable::~InsetCaptionable() in
libinsets.a(InsetFloat.o)
       lyx::InsetCaptionable::InsetCaptionable(lyx::InsetCaptionable
const&) in libinsets.a(InsetFloat.o)
       lyx::InsetCaptionable::InsetCaptionable(lyx::Buffer*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&) in libinsets.a(InsetListings.o)
       lyx::InsetCaptionable::~InsetCaptionable() in
libinsets.a(InsetListings.o)
       lyx::InsetCaptionable::InsetCaptionable(lyx::InsetCaptionable
const&) in libinsets.a(InsetListings.o)
       lyx::InsetCaptionable::InsetCaptionable(lyx::Buffer*) in
libinsets.a(InsetWrap.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)
---------------


Regards,

Patrick De Visschere




Dear Patrick,


1st error: is there a quick workaround to the bug that would help?

2nd error: does src/Makefile contain insets/InsetCaptionable.cpp? If
not, please re-run autogen.sh and configure.


Guillaume



Guillaume,

The 2nd error was my mistake; I used XCode and had to rerun CMake;

The first error is solved by modifying the "memory" file in XCode (full path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory)

as documented in the llvm repository (the libcxx project, commit de4b4f0 or svn r242377).

Regards,

Patrick De Visschere


Reply via email to