Opened 5 years ago

Last modified 5 years ago

#13171 new Bugs

Linker error when using boost::process::posix::use_vfork

Reported by: Ton van den Heuvel <tonvandenheuvel@…> Owned by:
Milestone: To Be Determined Component: process
Version: Boost 1.64.0 Severity: Problem
Keywords: Cc:

Description

Trying to build the following code using GCC 7.1.1 and Boost 1.64.0 fails:

#include <boost/process.hpp>

namespace bp = boost::process;

int main(void)
{
  bp::child c("ls", bp::posix::use_vfork);
  c.wait();
  return 0;
}

The following linker error is generated:

In function 'boost::process::detail::posix::executor >, boost::fusion::filter_view&, boost::process::detail::posix::use_vfork_ const&> const, boost::process::detail::is_initializer > > > >::operator()()': spawn_simple.cpp:(.text._ZN5boost7process6detail5posix8executorINS_6fusion10joint_viewINS4_5tupleIJNS2_12exe_cmd_initIcEEEEENS4_11filter_viewIKNS6_IJRA6_KcRNS2_8null_outILi1ELin1EEERKNS2_10use_vfork_EEEENS1_14is_initializerIN4mpl_3argILin1EEEEEEEEEEclEv[_ZN5boost7process6detail5posix8executorINS_6fusion10joint_viewINS4_5tupleIJNS2_12exe_cmd_initIcEEEEENS4_11filter_viewIKNS6_IJRA6_KcRNS2_8null_outILi1ELin1EEERKNS2_10use_vfork_EEEENS1_14is_initializerIN4mpl_3argILin1EEEEEEEEEEclEv]+0x31): undefined reference to `boost::process::detail::posix::executor >, boost::fusion::filter_view&, boost::process::detail::posix::use_vfork_ const&> const, boost::process::detail::is_initializer > > > >::invoke(mpl_::bool_, mpl_::bool_)'

Given that Boost Process is a header-only library, why is the linker complaining about unresolved symbols in boost::process::...::invoke()?

Change History (1)

comment:1 by Ton van den Heuvel <tonvandenheuvel@…>, 5 years ago

This can be resolved; vfork support was not enabled due to an incorrect #ifdef. See: https://github.com/klemens-morgenstern/boost-process/issues/118.

Note: See TracTickets for help on using tickets.