Oberon00 / luabind

Luabind is a library that helps you create bindings between C++ and Lua.
http://oberon00.github.io/luabind/
Other
46 stars 13 forks source link

Strange compile errors #22

Closed liclac closed 9 years ago

liclac commented 9 years ago

Looks like a simple case of a missing header, but I'm not sure which one. I'll try to fix it myself later, but it's probably a really simple fix for someone familiar with the codebase.

Running OSX 10.10.

➜  luabind git:(master) ✗ cmake .
-- Boost version: 1.57.0
-- Performing Test _HAS_CXX11_FLAG
-- Performing Test _HAS_CXX11_FLAG - Success
-- Checking C++ support for "auto"
-- Checking C++ support for "auto": works
-- Checking C++ support for "class_override_final"
-- Checking C++ support for "class_override_final": works
-- Checking C++ support for "constexpr"
-- Checking C++ support for "constexpr": works
-- Checking C++ support for "cstdint_header"
-- Checking C++ support for "cstdint_header": works
-- Checking C++ support for "decltype"
-- Checking C++ support for "decltype": works
-- Checking C++ support for "defaulted_functions"
-- Checking C++ support for "defaulted_functions": works
-- Checking C++ support for "deleted_functions"
-- Checking C++ support for "deleted_functions": works
-- Checking C++ support for "func_identifier"
-- Checking C++ support for "func_identifier": works
-- Checking C++ support for "initializer_list"
-- Checking C++ support for "initializer_list": works
-- Checking C++ support for "lambda"
-- Checking C++ support for "lambda": works
-- Checking C++ support for "long_long"
-- Checking C++ support for "long_long": works
-- Checking C++ support for "nullptr"
-- Checking C++ support for "nullptr": works
-- Checking C++ support for "rvalue_references"
-- Checking C++ support for "rvalue_references": works
-- Checking C++ support for "sizeof_member"
-- Checking C++ support for "sizeof_member": works
-- Checking C++ support for "static_assert"
-- Checking C++ support for "static_assert": works
-- Checking C++ support for "variadic_templates"
-- Checking C++ support for "variadic_templates": works
-- Found CXXFeatures: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/uppfinnarn/luabind
➜  luabind git:(master) ✗ make
[  1%] Building CXX object src/CMakeFiles/luabind.dir/class.cpp.o
In file included from /Users/uppfinnarn/luabind/src/class.cpp:25:
In file included from /Users/uppfinnarn/luabind/luabind/class.hpp:72:
In file included from /Users/uppfinnarn/luabind/luabind/back_reference.hpp:28:
In file included from /Users/uppfinnarn/luabind/luabind/wrapper_base.hpp:29:
In file included from /Users/uppfinnarn/luabind/luabind/detail/call_member.hpp:34:
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:192:13: error: implicit
      instantiation of undefined template 'std::__1::basic_ostream<char,
      std::__1::char_traits<char> >'
          os.setstate(std::ios::failbit);
            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:111:33: note:
      template is declared here
    class _LIBCPP_TYPE_VIS_ONLY basic_ostream;
                                ^
In file included from /Users/uppfinnarn/luabind/src/class.cpp:25:
In file included from /Users/uppfinnarn/luabind/luabind/class.hpp:72:
In file included from /Users/uppfinnarn/luabind/luabind/back_reference.hpp:28:
In file included from /Users/uppfinnarn/luabind/luabind/wrapper_base.hpp:29:
In file included from /Users/uppfinnarn/luabind/luabind/detail/call_member.hpp:34:
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:524:3: error: no matching
      function for call to 'operator=='
  LUABIND_OPERATOR_ADL_WKND(==)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:514:14: note: expanded from
      macro 'LUABIND_OPERATOR_ADL_WKND'
      return boost::operator op(x, y); \
             ^~~~~~~~~~~~~~~~~~
/usr/local/include/boost/bind/arg.hpp:41:24: note: candidate template ignored:
      could not match 'arg' against 'basic_iterator'
template< int I > bool operator==( arg<I> const &, arg<I> const & )
                       ^
/usr/local/include/boost/optional/optional.hpp:1244:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( optional<T> const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1278:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( optional<T> const& x, T const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1312:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( T const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1347:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
     ^
/usr/local/include/boost/optional/optional.hpp:1381:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( none_t , optional<T> const& y ) BOOST_NOEXCEPT
     ^
In file included from /Users/uppfinnarn/luabind/src/class.cpp:25:
In file included from /Users/uppfinnarn/luabind/luabind/class.hpp:72:
In file included from /Users/uppfinnarn/luabind/luabind/back_reference.hpp:28:
In file included from /Users/uppfinnarn/luabind/luabind/wrapper_base.hpp:29:
In file included from /Users/uppfinnarn/luabind/luabind/detail/call_member.hpp:34:
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:524:3: error: no matching
      function for call to 'operator=='
  LUABIND_OPERATOR_ADL_WKND(==)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:521:14: note: expanded from
      macro 'LUABIND_OPERATOR_ADL_WKND'
      return boost::operator op(x, y); \
             ^~~~~~~~~~~~~~~~~~
/usr/local/include/boost/bind/arg.hpp:41:24: note: candidate template ignored:
      could not match 'arg' against 'basic_iterator'
template< int I > bool operator==( arg<I> const &, arg<I> const & )
                       ^
/usr/local/include/boost/optional/optional.hpp:1244:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( optional<T> const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1278:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( optional<T> const& x, T const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1312:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( T const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1347:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
     ^
/usr/local/include/boost/optional/optional.hpp:1381:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator == ( none_t , optional<T> const& y ) BOOST_NOEXCEPT
     ^
In file included from /Users/uppfinnarn/luabind/src/class.cpp:25:
In file included from /Users/uppfinnarn/luabind/luabind/class.hpp:72:
In file included from /Users/uppfinnarn/luabind/luabind/back_reference.hpp:28:
In file included from /Users/uppfinnarn/luabind/luabind/wrapper_base.hpp:29:
In file included from /Users/uppfinnarn/luabind/luabind/detail/call_member.hpp:34:
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:525:3: error: no matching
      function for call to 'operator!='
  LUABIND_OPERATOR_ADL_WKND(!=)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:514:14: note: expanded from
      macro 'LUABIND_OPERATOR_ADL_WKND'
      return boost::operator op(x, y); \
             ^~~~~~~~~~~~~~~~~~
/usr/local/include/boost/optional/optional.hpp:1254:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( optional<T> const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1288:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( optional<T> const& x, T const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1322:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( T const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1357:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
     ^
/usr/local/include/boost/optional/optional.hpp:1391:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( none_t, optional<T> const& y ) BOOST_NOEXCEPT
     ^
In file included from /Users/uppfinnarn/luabind/src/class.cpp:25:
In file included from /Users/uppfinnarn/luabind/luabind/class.hpp:72:
In file included from /Users/uppfinnarn/luabind/luabind/back_reference.hpp:28:
In file included from /Users/uppfinnarn/luabind/luabind/wrapper_base.hpp:29:
In file included from /Users/uppfinnarn/luabind/luabind/detail/call_member.hpp:34:
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:525:3: error: no matching
      function for call to 'operator!='
  LUABIND_OPERATOR_ADL_WKND(!=)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:521:14: note: expanded from
      macro 'LUABIND_OPERATOR_ADL_WKND'
      return boost::operator op(x, y); \
             ^~~~~~~~~~~~~~~~~~
/usr/local/include/boost/optional/optional.hpp:1254:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( optional<T> const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1288:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( optional<T> const& x, T const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1322:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( T const& x, optional<T> const& y )
     ^
/usr/local/include/boost/optional/optional.hpp:1357:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
     ^
/usr/local/include/boost/optional/optional.hpp:1391:6: note: candidate template
      ignored: could not match 'optional' against 'basic_iterator'
bool operator != ( none_t, optional<T> const& y ) BOOST_NOEXCEPT
     ^
5 errors generated.
make[2]: *** [src/CMakeFiles/luabind.dir/class.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/luabind.dir/all] Error 2
make: *** [all] Error 2
Oberon00 commented 9 years ago

Seems like I need to test the library with Boost 1.57.

/Users/uppfinnarn/luabind/luabind/detail/object.hpp:192:13: error: implicit
instantiation of undefined template 'std::__1::basic_ostream<char,
    std::__1::char_traits<char> >'
    os.setstate(std::ios::failbit);

Try adding #include <iostream> or <ostream> in detail/object.hpp.

/Users/uppfinnarn/luabind/luabind/detail/object.hpp:524:3: error: no matching
    function for call to 'operator=='
LUABIND_OPERATOR_ADL_WKND(==)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/uppfinnarn/luabind/luabind/detail/object.hpp:514:14: note: expanded from
    macro 'LUABIND_OPERATOR_ADL_WKND'
    return boost::operator op(x, y); \
            ^~~~~~~~~~~~~~~~~~

Hmm. Try changing boost::operator to boost::iterators::operator here or change the returns to return x op y;.

liclac commented 9 years ago

Improvement! The errors disappeared, but now there's another one instead.

diff --git a/luabind/detail/object.hpp b/luabind/detail/object.hpp
index c69082f..365ec96 100644
--- a/luabind/detail/object.hpp
+++ b/luabind/detail/object.hpp
@@ -41,6 +41,8 @@
 #include <boost/tuple/tuple.hpp>
 #include <boost/utility/enable_if.hpp>

+#include <iostream>
+
 namespace luabind {

 namespace adl
@@ -511,14 +513,14 @@ namespace detail
       basic_iterator<basic_access> const& x \
     , basic_iterator<basic_access> const& y) \
   { \
-      return boost::operator op(x, y); \
+      return boost::iterators::operator op(x, y); \
   } \
  \
   inline bool operator op( \
       basic_iterator<raw_access> const& x \
     , basic_iterator<raw_access> const& y) \
   { \
-      return boost::operator op(x, y); \
+      return boost::iterators::operator op(x, y); \
   }

   LUABIND_OPERATOR_ADL_WKND(==)
Scanning dependencies of target luabind
[  1%] Building CXX object src/CMakeFiles/luabind.dir/class.cpp.o
[  2%] Building CXX object src/CMakeFiles/luabind.dir/class_info.cpp.o
[  4%] Building CXX object src/CMakeFiles/luabind.dir/class_registry.cpp.o
[  4%] Building CXX object src/CMakeFiles/luabind.dir/class_rep.cpp.o
[  5%] Building CXX object src/CMakeFiles/luabind.dir/create_class.cpp.o
[  7%] Building CXX object src/CMakeFiles/luabind.dir/error.cpp.o
[  8%] Building CXX object src/CMakeFiles/luabind.dir/exception_handler.cpp.o
[ 10%] Building CXX object src/CMakeFiles/luabind.dir/function.cpp.o
[ 11%] Building CXX object src/CMakeFiles/luabind.dir/function_introspection.cpp.o
[ 12%] Building CXX object src/CMakeFiles/luabind.dir/inheritance.cpp.o
[ 14%] Building CXX object src/CMakeFiles/luabind.dir/link_compatibility.cpp.o
[ 15%] Building CXX object src/CMakeFiles/luabind.dir/object_rep.cpp.o
[ 17%] Building CXX object src/CMakeFiles/luabind.dir/open.cpp.o
[ 18%] Building CXX object src/CMakeFiles/luabind.dir/operator.cpp.o
[ 20%] Building CXX object src/CMakeFiles/luabind.dir/pcall.cpp.o
[ 20%] Building CXX object src/CMakeFiles/luabind.dir/scope.cpp.o
[ 21%] Building CXX object src/CMakeFiles/luabind.dir/set_package_preload.cpp.o
[ 22%] Building CXX object src/CMakeFiles/luabind.dir/shared_ptr_converter.cpp.o
[ 24%] Building CXX object src/CMakeFiles/luabind.dir/stack_content_by_name.cpp.o
[ 25%] Building CXX object src/CMakeFiles/luabind.dir/weak_ref.cpp.o
[ 27%] Building CXX object src/CMakeFiles/luabind.dir/wrapper_base.cpp.o
Linking CXX static library libluabind09.a
[ 27%] Built target luabind
Scanning dependencies of target benchmark
[ 27%] Building CXX object test/CMakeFiles/benchmark.dir/benchmark.cpp.o
Linking CXX executable benchmark
[ 27%] Built target benchmark
Scanning dependencies of target test_main
[ 28%] Building CXX object test/CMakeFiles/test_main.dir/main.cpp.o
[ 30%] Building CXX object test/CMakeFiles/test_main.dir/test_has_get_pointer.cpp.o
Linking CXX static library libtest_main.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libtest_main.a(test_has_get_pointer.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libtest_main.a(test_has_get_pointer.cpp.o) has no symbols
[ 30%] Built target test_main
Scanning dependencies of target test_abstract_base
[ 31%] Building CXX object test/CMakeFiles/test_abstract_base.dir/test_abstract_base.cpp.o
Linking CXX executable test_abstract_base
[ 31%] Built target test_abstract_base
Scanning dependencies of target test_adopt
[ 32%] Building CXX object test/CMakeFiles/test_adopt.dir/test_adopt.cpp.o
Linking CXX executable test_adopt
[ 32%] Built target test_adopt
Scanning dependencies of target test_adopt_wrapper
[ 34%] Building CXX object test/CMakeFiles/test_adopt_wrapper.dir/test_adopt_wrapper.cpp.o
Linking CXX executable test_adopt_wrapper
[ 34%] Built target test_adopt_wrapper
Scanning dependencies of target test_attributes
[ 35%] Building CXX object test/CMakeFiles/test_attributes.dir/test_attributes.cpp.o
Linking CXX executable test_attributes
[ 35%] Built target test_attributes
Scanning dependencies of target test_automatic_smart_ptr
[ 37%] Building CXX object test/CMakeFiles/test_automatic_smart_ptr.dir/test_automatic_smart_ptr.cpp.o
Linking CXX executable test_automatic_smart_ptr
[ 37%] Built target test_automatic_smart_ptr
Scanning dependencies of target test_back_reference
[ 38%] Building CXX object test/CMakeFiles/test_back_reference.dir/test_back_reference.cpp.o
Linking CXX executable test_back_reference
[ 38%] Built target test_back_reference
Scanning dependencies of target test_builtin_converters
[ 38%] Building CXX object test/CMakeFiles/test_builtin_converters.dir/test_builtin_converters.cpp.o
Linking CXX executable test_builtin_converters
[ 38%] Built target test_builtin_converters
Scanning dependencies of target test_class_info
[ 40%] Building CXX object test/CMakeFiles/test_class_info.dir/test_class_info.cpp.o
Linking CXX executable test_class_info
[ 40%] Built target test_class_info
Scanning dependencies of target test_collapse_converter
[ 41%] Building CXX object test/CMakeFiles/test_collapse_converter.dir/test_collapse_converter.cpp.o
Linking CXX executable test_collapse_converter
[ 41%] Built target test_collapse_converter
Scanning dependencies of target test_const
[ 42%] Building CXX object test/CMakeFiles/test_const.dir/test_const.cpp.o
Linking CXX executable test_const
[ 42%] Built target test_const
Scanning dependencies of target test_construction
[ 44%] Building CXX object test/CMakeFiles/test_construction.dir/test_construction.cpp.o
Linking CXX executable test_construction
[ 44%] Built target test_construction
Scanning dependencies of target test_create_in_thread
[ 45%] Building CXX object test/CMakeFiles/test_create_in_thread.dir/test_create_in_thread.cpp.o
Linking CXX executable test_create_in_thread
[ 45%] Built target test_create_in_thread
Scanning dependencies of target test_def_from_base
[ 47%] Building CXX object test/CMakeFiles/test_def_from_base.dir/test_def_from_base.cpp.o
Linking CXX executable test_def_from_base
[ 47%] Built target test_def_from_base
Scanning dependencies of target test_destruction
[ 48%] Building CXX object test/CMakeFiles/test_destruction.dir/test_destruction.cpp.o
Linking CXX executable test_destruction
[ 48%] Built target test_destruction
Scanning dependencies of target test_dynamic_type
[ 50%] Building CXX object test/CMakeFiles/test_dynamic_type.dir/test_dynamic_type.cpp.o
Linking CXX executable test_dynamic_type
[ 50%] Built target test_dynamic_type
Scanning dependencies of target test_exception_handlers
[ 51%] Building CXX object test/CMakeFiles/test_exception_handlers.dir/test_exception_handlers.cpp.o
Linking CXX executable test_exception_handlers
[ 51%] Built target test_exception_handlers
Scanning dependencies of target test_exceptions
[ 52%] Building CXX object test/CMakeFiles/test_exceptions.dir/test_exceptions.cpp.o
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_exceptions.cpp:31:13: warning:
      definition of implicit copy constructor for 'ex' is deprecated because it
      has a user-declared destructor [-Wdeprecated]
    virtual ~ex() LUABIND_NOEXCEPT {}
            ^
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_exceptions.cpp:44:13: note:
      implicit copy constructor for 'ex' first required here
    { throw ex("exception description"); }
            ^
1 warning generated.
Linking CXX executable test_exceptions
[ 52%] Built target test_exceptions
Scanning dependencies of target test_extend_class_in_lua
[ 54%] Building CXX object test/CMakeFiles/test_extend_class_in_lua.dir/test_extend_class_in_lua.cpp.o
Linking CXX executable test_extend_class_in_lua
[ 54%] Built target test_extend_class_in_lua
Scanning dependencies of target test_free_functions
[ 54%] Building CXX object test/CMakeFiles/test_free_functions.dir/test_free_functions.cpp.o
Linking CXX executable test_free_functions
[ 54%] Built target test_free_functions
Scanning dependencies of target test_function_converter
[ 55%] Building CXX object test/CMakeFiles/test_function_converter.dir/test_function_converter.cpp.o
Linking CXX executable test_function_converter
[ 55%] Built target test_function_converter
Scanning dependencies of target test_function_introspection
[ 57%] Building CXX object test/CMakeFiles/test_function_introspection.dir/test_function_introspection.cpp.o
Linking CXX executable test_function_introspection
[ 57%] Built target test_function_introspection
Scanning dependencies of target test_function_object
[ 58%] Building CXX object test/CMakeFiles/test_function_object.dir/test_function_object.cpp.o
Linking CXX executable test_function_object
[ 58%] Built target test_function_object
Scanning dependencies of target test_held_type
[ 60%] Building CXX object test/CMakeFiles/test_held_type.dir/test_held_type.cpp.o
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_held_type.cpp:57:13: warning:
      definition of implicit copy constructor for 'first_base' is deprecated
      because it has a user-declared destructor [-Wdeprecated]
    virtual ~first_base() {}
            ^
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_held_type.cpp:62:8: note:
      implicit copy constructor for 'first_base' first required here
struct derived : first_base, base
       ^
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_held_type.cpp:45:13: warning:
      definition of implicit copy constructor for 'base' is deprecated because
      it has a user-declared destructor [-Wdeprecated]
    virtual ~base() {}
            ^
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_held_type.cpp:62:8: note:
      implicit copy constructor for 'base' first required here
struct derived : first_base, base
       ^
2 warnings generated.
Linking CXX executable test_held_type
[ 60%] Built target test_held_type
Scanning dependencies of target test_implicit_cast
[ 61%] Building CXX object test/CMakeFiles/test_implicit_cast.dir/test_implicit_cast.cpp.o
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/test/test_implicit_cast.cpp:24:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/luabind.hpp:27:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/class.hpp:80:
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/enum_maker.hpp:119:18: warning:
      definition of implicit copy constructor for
      'enum_maker<luabind::class_<<anonymous>::enum_placeholder,
      luabind::detail::unspecified, luabind::detail::unspecified,
      luabind::detail::unspecified> >' is deprecated because it has a
      user-declared copy assignment operator [-Wdeprecated]
            void operator=(enum_maker const&); // C4512, assignment oper...
                 ^
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_implicit_cast.cpp:86:14: note:
      in instantiation of member function
      'luabind::class_<<anonymous>::enum_placeholder,
      luabind::detail::unspecified, luabind::detail::unspecified,
      luabind::detail::unspecified>::enum_' requested here
            .enum_("constants")
             ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/class.hpp:727:20: note:
      implicit copy constructor for
      'enum_maker<luabind::class_<<anonymous>::enum_placeholder,
      luabind::detail::unspecified, luabind::detail::unspecified,
      luabind::detail::unspecified> >' first required here
            return detail::enum_maker<self_t>(*this);
                   ^
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/test/test_implicit_cast.cpp:24:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/luabind.hpp:27:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/class.hpp:72:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/back_reference.hpp:28:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/wrapper_base.hpp:29:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/call_member.hpp:30:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/convert_to_lua.hpp:28:
In file included from /Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/policy.hpp:72:
/usr/local/include/boost/core/underlying_type.hpp:73:12: error: implicit
      instantiation of undefined template
      'boost::detail::underlying_type_impl<<anonymous>::LBENUM_t, void>'
    public detail::underlying_type_impl< EnumType >
           ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/policy.hpp:503:37: note:
      in instantiation of template class
      'boost::underlying_type<<anonymous>::LBENUM_t>' requested here
            typedef typename boost::underlying_type<T>::type integral_t;
                                    ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/call.hpp:295:34: note:
      in instantiation of function template specialization
      'luabind::detail::enum_converter::apply<<anonymous>::LBENUM_t>' requested
      here
                BOOST_PP_ENUM(N, LUABIND_INVOKE_ARG, LUABIND_INVOKE_IDENTITY)
                                 ^
/usr/local/include/boost/preprocessor/repetition/enum.hpp:35:79: note: expanded
      from macro 'BOOST_PP_ENUM_1'
  ...BOOST_PP_ENUM_1(c, m, d) BOOST_PP_REPEAT_1(c, BOOST_PP_ENUM_M_1, (m, d))
                                                                       ^
/usr/local/include/boost/preprocessor/repetition/repeat.hpp:38:63: note:
      expanded from macro 'BOOST_PP_REPEAT_1'
# define BOOST_PP_REPEAT_1(c, m, d) BOOST_PP_REPEAT_1_I(c, m, d)
                                                              ^
/usr/local/include/boost/preprocessor/repetition/repeat.hpp:43:66: note:
      expanded from macro 'BOOST_PP_REPEAT_1_I'
# define BOOST_PP_REPEAT_1_I(c, m, d) BOOST_PP_REPEAT_1_ ## c(m, d)
                                                                 ^
note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/usr/local/include/boost/preprocessor/repetition/enum.hpp:53:70: note: expanded
      from macro 'BOOST_PP_ENUM_M_1_IM'
#    define BOOST_PP_ENUM_M_1_IM(z, n, im) BOOST_PP_ENUM_M_1_I(z, n, im)
                                                                     ^
/usr/local/include/boost/preprocessor/repetition/enum.hpp:62:63: note: expanded
      from macro 'BOOST_PP_ENUM_M_1_I'
# define BOOST_PP_ENUM_M_1_I(z, n, m, d) BOOST_PP_COMMA_IF(n) m(z, n, d)
                                                              ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/call.hpp:168:29: note:
      expanded from macro 'LUABIND_INVOKE_ARG'
    BOOST_PP_CAT(c,base(n)).apply( \
                            ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/call.hpp:88:12: note:
      in instantiation of function template specialization
      'luabind::detail::invoke_normal<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t),
      boost::function_types::components<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t), boost::add_reference<mpl_::arg<-1> > >,
      luabind::detail::null_type>' requested here
    return invoke_normal(
           ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/detail/call.hpp:99:12: note:
      in instantiation of function template specialization
      'luabind::detail::invoke0<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t),
      boost::function_types::components<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t), boost::add_reference<mpl_::arg<-1> > >,
      luabind::detail::null_type, boost::is_void<<anonymous>::LBENUM_t> >'
      requested here
    return invoke0(
           ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/make_function.hpp:62:25: note:
      in instantiation of function template specialization
      'luabind::detail::invoke<<anonymous>::LBENUM_t (*)(<anonymous>::LBENUM_t),
      boost::function_types::components<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t), boost::add_reference<mpl_::arg<-1> > >,
      luabind::detail::null_type>' requested here
              results = invoke(
                        ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/make_function.hpp:32:28: note:
      (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see
      all)
        : function_object(&entry_point)
                           ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/make_function.hpp:107:13: note:
      in instantiation of member function
      'luabind::detail::function_object_impl<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t),
      boost::function_types::components<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t), boost::add_reference<mpl_::arg<-1> > >,
      luabind::detail::null_type>::function_object_impl' requested here
      , new detail::function_object_impl<F, Signature, Policies>(
            ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/function.hpp:28:23: note:
      in instantiation of function template specialization
      'luabind::make_function<<anonymous>::LBENUM_t (*)(<anonymous>::LBENUM_t),
      boost::function_types::components<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t), boost::add_reference<mpl_::arg<-1> > >,
      luabind::detail::null_type>' requested here
          object fn = make_function(L, f, deduce_signature(f), policies);
                      ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/function.hpp:48:13: note:
      in instantiation of member function
      'luabind::detail::function_registration<<anonymous>::LBENUM_t
      (*)(<anonymous>::LBENUM_t), luabind::detail::null_type>::register_'
      requested here
        new detail::function_registration<F, Policies>(name, f, policies)));
            ^
/Users/uppfinnarn/Projects/Libraries/luabind/luabind/function.hpp:54:12: note:
      in instantiation of function template specialization
      'luabind::def<<anonymous>::LBENUM_t (*)(<anonymous>::LBENUM_t),
      luabind::detail::null_type>' requested here
    return def(name, f, detail::null_type());
           ^
/Users/uppfinnarn/Projects/Libraries/luabind/test/test_implicit_cast.cpp:91:9: note:
      in instantiation of function template specialization
      'luabind::def<<anonymous>::LBENUM_t (*)(<anonymous>::LBENUM_t)>' requested
      here
        def("enum_by_val", &enum_by_val),
        ^
/usr/local/include/boost/core/underlying_type.hpp:31:8: note: template is
      declared here
struct underlying_type_impl;
       ^
1 warning and 1 error generated.
make[2]: *** [test/CMakeFiles/test_implicit_cast.dir/test_implicit_cast.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_implicit_cast.dir/all] Error 2
make: *** [all] Error 2
liclac commented 9 years ago

Ah, looks like passing -DLUABIND_NO_SCOPED_ENUM:BOOL=ON to CMake fixes it. Would it be possible to autodetect when these are available?

Oberon00 commented 9 years ago

See bee4b85a9bcb48b707980b9016eaddb287be3deb.

liclac commented 9 years ago

Ah, looks like it's only needed for that one unit test, nevermind then. That PR fixes the actual library building, if you don't mind the placement of the include.

Oberon00 commented 9 years ago

(Hopefully) fixed by 9a2a2f1aa23cbb5d5e46a776b49415d071bac187 and fb3c6623c728209a2ba69d178bd87589bf04e9cf. Please tell me if not.