boostorg / proto

Boost.org proto module
http://boost.org/libs/proto
21 stars 38 forks source link

Boost.Proto 1.68.0 - display_expr undefined reference symbol #6

Closed preejackie closed 5 years ago

preejackie commented 5 years ago

Hi I'm going some basic examples.


#include <iostream>

#include <boost/proto/proto.hpp>

struct variable_tag {};

using namespace boost;

proto::terminal<variable_tag>::type _x = {{}};

int main(int argc, char const *argv[])
{

    _x %= _x + 3 * ~(_x >> 6);

    proto::display_expr( _x+2 );
} 

It compiles fine, but linker throwing undefined reference symbol. 
\/tmp/ccn7qlLW.o: In function `void boost::proto::detail::display_expr_impl::impl<boost::proto::exprns_::expr<boost::proto::tagns_::tag::plus, boost::proto::argsns_::list2<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<variable_tag>, 0l>&, boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<int const&>, 0l> >, 2l>, mpl_::long_<2l> >(boost::proto::exprns_::expr<boost::proto::tagns_::tag::plus, boost::proto::argsns_::list2<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<variable_tag>, 0l>&, boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<int const&>, 0l> >, 2l> const&, mpl_::long_<2l>) const':
none1.cpp:(.text._ZNK5boost5proto6detail17display_expr_impl4implINS0_7exprns_4exprINS0_6tagns_3tag4plusENS0_7argsns_5list2IRNS5_INS7_8terminalENS9_4termI12variable_tagEELl0EEENS5_ISB_NSC_IRKiEELl0EEEEELl2EEEN4mpl_5long_ILl2EEEEEvRKT_T0_[_ZNK5boost5proto6detail17display_expr_impl4implINS0_7exprns_4exprINS0_6tagns_3tag4plusENS0_7argsns_5list2IRNS5_INS7_8terminalENS9_4termI12variable_tagEELl0EEENS5_ISB_NSC_IRKiEELl0EEEEELl2EEEN4mpl_5long_ILl2EEEEEvRKT_T0_]+0xd3): undefined reference to `boost::proto::detail::display_expr_impl::display_expr_impl(boost::proto::detail::display_expr_impl const&)'
collect2: error: ld returned 1 exit status

**The display_expr_impl (display_expr_impl const &) is declared as a private member and not defined.** 

Is there any way to resolve this issue ? 
Thanks
Burgos commented 5 years ago

Fixed in https://github.com/boostorg/proto/pull/7

preejackie commented 5 years ago

It's working, thanks :+1: