Errors when trying to do make or build project via XCode

Started by ColaGGS, 08 March 2014, 16:35:36

ColaGGS

Hello,
I've just installed tgui, tried installing as UNIX Makefile and XCode project, though i didn't seem to understand what the error was about. I found a link that refers that clang might have some bugs. And i will post the error:


Scanning dependencies of target tgui
[  2%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Callback.cpp.o
In file included from /Users/cola/TGUI-0.6.1/src/TGUI/Callback.cpp:26:
In file included from /Users/cola/TGUI-0.6.1/include/TGUI/Callback.hpp:29:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:371:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__tree:16:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:599:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:234:73: error:
      no matching constructor for initialization of
      'std::__1::reference_wrapper<const tgui::Callback>'
             _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : value()
                                                                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:447:23: note:
      in instantiation of member function 'std::__1::__tuple_leaf<0,
      std::__1::reference_wrapper<const tgui::Callback>, false>::__tuple_leaf'
      requested here
    _LIBCPP_CONSTEXPR __tuple_impl()
                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:550:23: note:
      in instantiation of member function
      'std::__1::__tuple_impl<std::__1::__tuple_indices<0>,
      std::__1::reference_wrapper<const tgui::Callback> >::__tuple_impl'
      requested here
    _LIBCPP_CONSTEXPR tuple()
                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1744:11: note:
      in instantiation of member function
      'std::__1::tuple<std::__1::reference_wrapper<const tgui::Callback>
      >::tuple' requested here
          __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2243:15: note:
      in instantiation of function template specialization
      'std::__1::__bind<std::__1::function<void (const tgui::Callback &)> &,
      std::__1::reference_wrapper<const tgui::Callback>
      >::__bind<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> >, , void>' requested here
              __first_(_VSTD::forward<_Args1>(get<_I1>(__first_args))...)
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2421:15: note:
      in instantiation of function template specialization
      'std::__1::__libcpp_compressed_pair_imp<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> >,
      std::__1::allocator<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> > >,
      2>::__libcpp_compressed_pair_imp<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> > &&, , 0, >' requested here
            : base(__pc, _VSTD::move(__first_args), _VSTD::move(__second_args),
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:992:11: note:
      in instantiation of function template specialization
      'std::__1::__compressed_pair<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> >,
      std::__1::allocator<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> > >
      >::__compressed_pair<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> > &&, >' requested here
        : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1277:26: note:
      in instantiation of member function
      'std::__1::__function::__func<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> >,
      std::__1::allocator<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> > >, void ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
/Users/cola/TGUI-0.6.1/src/TGUI/Callback.cpp:43:21: note: in instantiation of
      function template specialization 'std::__1::function<void
      ()>::function<std::__1::__bind<std::__1::function<void
      (const tgui::Callback &)> &, std::__1::reference_wrapper<const
      tgui::Callback> > >' requested here
        mapCallback(std::bind(func, std::cref(m_Callback)), trigger);
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__functional_base:365:31: note:
      candidate constructor not viable: requires single argument '__f', but no
      arguments were provided
    _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT : _...
                              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__functional_base:367:14: note:
      candidate constructor not viable: requires 1 argument, but 0 were provided
    private: reference_wrapper(type&&); public: // = delete; // do not b...
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__functional_base:354:24: note:
      candidate constructor (the implicit copy constructor) not viable: requires
      1 argument, but 0 were provided
class _LIBCPP_TYPE_VIS reference_wrapper
                       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__functional_base:354:24: note:
      candidate constructor (the implicit move constructor) not viable: requires
      1 argument, but 0 were provided
1 error generated.
make[2]: *** [src/TGUI/CMakeFiles/tgui.dir/Callback.cpp.o] Error 1
make[1]: *** [src/TGUI/CMakeFiles/tgui.dir/all] Error 2
make: *** [all] Error 2


currently my mac uses clang 5.0.2( llvm 3.3)

texus

This indeed seems to be the same problem as in the other topic.

As far as I know, this is a regression bug in clang.
It works fine on OS X Mountain Lion (llvm 3.2), it works fine on Linux with clang 3.4, it just doesn't work on OS X Mavericks (llvm 3.3).

I'm not even sure where to report the bug. I have no idea whether the bug is in official clang 3.3 or in the apple 5.0 version. And I don't really have the time to figure that out.

I've been hoping that the bug would be fixed automatically with an XCode update, but I'm starting to lose hope for that.

ColaGGS

oh, it is indeed strange, as i posted on apple's forums, and my only response from them was clang is better than gcc. It seems like clang is strangely awful in mavericks, since i came across so many bugs so far. Hm... I'll keep searching. And if something comes up i'll post here.

Now in mean time, gotta find a way to install gcc on mavericks. Thx for the note.

EDIT: Problem caused the Mac 10.9 libc++, the latest libc++ from llvm should fix the problem. Also XCode 5.1 that is going to be released should also fix the problem as well. I will confirm as soon as i get my hands on both of them.

texus

I got my hands on XCode 5.1 Developer Preview 2. The bug indeed seems to be fixed.
So I guess I just have to wait until XCode 5.1 gets released.

The compilation now also seems to fail because I am missing "#include <cmath>" in two files, but I've fixed that on github so you download the latest sources from there.

I also tried installing gcc, but I didn't get it to work.

ColaGGS

Yep XCode 5.1 worked, but now i get 44 errors saying lexical or preprocessor Issue in FormBuilder. I downloaded from github and compiled it with cmake for xcode.

texus

It seems like these are just warnings. And they are in a apple library that the form builder uses, so I can't do much about them.

But the form builder won't start, it doesn't even give an error, so I might have to look into this.
I forgot that the form builder doesn't work on mac when the install target isn't build.