Opened 9 years ago

Closed 9 years ago

#9250 closed Bugs (fixed)

ext/boost/bind/bind.hpp" line 70: Error: boost::_bi::F is not a namespace or class name

Reported by: anonymous Owned by: Peter Dimov
Milestone: To Be Determined Component: bind
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

Whilst compiling Phusion Passenger which is including the Boost 1.52 header files.

OS: Solaris 10 SPARC Compiler: Sun Studio 12.3

"ext/boost/bind/bind.hpp", line 70: Error: boost::_bi::F is not a namespace or class name.
"ext/boost/bind/bind_template.hpp", line 15:     Where: While specializing "boost::_bi::result_traits<boost::_bi::unspecified, extern "C" int(*)(DIR*)>".
"ext/boost/bind/bind_template.hpp", line 15:     Where: Specialized in boost::_bi::bind_t<boost::_bi::unspecified, extern "C" int(*)(DIR*), boost::_bi::list1<boost::_bi::value<DIR*>>>.
"ext/common/ApplicationPool2/Spawner.h", line 250:     Where: Specialized in non-template code.
"ext/boost/bind/bind.hpp", line 70: Error: result_type is not defined.
"ext/boost/bind/bind_template.hpp", line 15:     Where: While specializing "boost::_bi::result_traits<boost::_bi::unspecified, extern "C" int(*)(DIR*)>".
"ext/boost/bind/bind_template.hpp", line 15:     Where: Specialized in boost::_bi::bind_t<boost::_bi::unspecified, extern "C" int(*)(DIR*), boost::_bi::list1<boost::_bi::value<DIR*>>>.

The code from bind.hpp:

    66  struct unspecified {};
    67
    68  template<class F>
    69  struct result_traits<unspecified, F> {
    70      typedef typename F::result_type type;
    71  };
    72
    73  template<class F>
    74  struct result_traits<unspecified, reference_wrapper<F> > {
    75      typedef typename F::result_type type;
    76  };

Change History (3)

comment:1 by Peter Dimov, 9 years ago

"ext/common/ApplicationPool2/Spawner.h", line 250 should contain something like boost::bind(closedir, ...). It needs to be changed to boost::bind<int>(closedir, ...). The problem is that on this compiler extern "C" functions are distinct from ordinary C++ functions.

http://www.boost.org/doc/libs/1_54_0/libs/bind/bind.html#Q_extern_C

comment:2 by anonymous, 9 years ago

Thanks, that '<int>' seems to have fixed this issue. I'll pass on the diff.

comment:3 by Peter Dimov, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.