Benjamin-Dobell / Heimdall

Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy devices.
MIT License
2.62k stars 587 forks source link

Compilation Fails on Mac OS 10.13.4 #464

Open ojss opened 6 years ago

ojss commented 6 years ago

Cmake seems to configuring everything correctly. However once I run make I get an error from clang about one of the files in libpit.

I checked the CmakeLists.txt to ensure that the c++11 std is set but even then it fails to compile. I am open to making changes to code, if someone can guide me.

Cmake command used: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DDISABLE_FRONTEND=ON ..

Trace

[  6%] Building CXX object libpit/CMakeFiles/pit.dir/source/libpit.cpp.o
In file included from /Users/ojas/Documents/GitHub/Heimdall/libpit/source/libpit.cpp:22:
In file included from /Users/ojas/Documents/GitHub/Heimdall/libpit/source/libpit.h:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:470:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:169:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:643:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2051:9: error: cannot
      initialize a member subobject of type 'libpit::PitEntry **' with an rvalue of type 'int'
      : __value_(_VSTD::forward<_Up>(__u)){};
        ^        ~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2141:9: note: in instantiation
      of function template specialization 'std::__1::__compressed_pair_elem<libpit::PitEntry **, 0, false>::__compressed_pair_elem<int,
      void>' requested here
      : _Base1(std::forward<_Tp>(__t)), _Base2() {}
        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:423:7: note: in instantiation
      of function template specialization 'std::__1::__compressed_pair<libpit::PitEntry **, std::__1::allocator<libpit::PitEntry *>
      >::__compressed_pair<int, true>' requested here
      __end_cap_(nullptr)
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:473:5: note: in instantiation
      of member function 'std::__1::__vector_base<libpit::PitEntry *, std::__1::allocator<libpit::PitEntry *> >::__vector_base'
      requested here
    vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
    ^
/Users/ojas/Documents/GitHub/Heimdall/libpit/source/libpit.cpp:65:10: note: in instantiation of member function
      'std::__1::vector<libpit::PitEntry *, std::__1::allocator<libpit::PitEntry *> >::vector' requested here
PitData::PitData()
         ^
In file included from /Users/ojas/Documents/GitHub/Heimdall/libpit/source/libpit.cpp:22:
In file included from /Users/ojas/Documents/GitHub/Heimdall/libpit/source/libpit.h:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:470:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:169:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:643:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2151:9: error: no matching
      constructor for initialization of '__compressed_pair_elem<libpit::PitEntry **, 0>'
      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
        ^      ~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__split_buffer:309:7: note: in
      instantiation of function template specialization 'std::__1::__compressed_pair<libpit::PitEntry **,
      std::__1::allocator<libpit::PitEntry *> &>::__compressed_pair<int, std::__1::allocator<libpit::PitEntry *> &>' requested here
    : __end_cap_(nullptr, __a)
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1036:53: note: in
      instantiation of member function 'std::__1::__split_buffer<libpit::PitEntry *, std::__1::allocator<libpit::PitEntry *>
      &>::__split_buffer' requested here
        __split_buffer<value_type, allocator_type&> __v(__recommend(size() + __n), size(), __a);
                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1997:15: note: in
      instantiation of member function 'std::__1::vector<libpit::PitEntry *, std::__1::allocator<libpit::PitEntry *> >::__append'
      requested here
        this->__append(__sz - __cs);
              ^
/Users/ojas/Documents/GitHub/Heimdall/libpit/source/libpit.cpp:99:10: note: in instantiation of member function
      'std::__1::vector<libpit::PitEntry *, std::__1::allocator<libpit::PitEntry *> >::resize' requested here
        entries.resize(entryCount);
                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2037:8: note: candidate
      constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const
      std::__1::__compressed_pair_elem<libpit::PitEntry **, 0, false>' for 1st argument
struct __compressed_pair_elem {
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2037:8: note: candidate
      constructor (the implicit move constructor) not viable: no known conversion from 'int' to
      'std::__1::__compressed_pair_elem<libpit::PitEntry **, 0, false>' for 1st argument
struct __compressed_pair_elem {
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2050:3: note: candidate
      template ignored: substitution failure [with _Up = int, $1 = void]
  __compressed_pair_elem(_Up&& __u)
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2055:3: note: candidate
      constructor template not viable: requires 3 arguments, but 1 was provided
  __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2043:39: note: candidate
      constructor not viable: requires 0 arguments, but 1 was provided
  _LIBCPP_INLINE_VISIBILITY constexpr __compressed_pair_elem() : __value_() {}
                                      ^
2 errors generated.
make[2]: *** [libpit/CMakeFiles/pit.dir/source/libpit.cpp.o] Error 1
make[1]: *** [libpit/CMakeFiles/pit.dir/all] Error 2
make: *** [all] Error 2

Thank you