Skip to content

Build failure against external tdlib on macOS: tgchat.cpp: error: no viable overloaded '=' #536

@barracuda156

Description

@barracuda156

Description:
Build against the latest version of tdlib fails:

[ 95%] Building CXX object CMakeFiles/nchat.dir/src/uiview.cpp.o
/opt/local/bin/ccache /opt/local/bin/ccache /opt/local/bin/clang++-mp-17 -DCMAKE_INSTALL_LIBDIR=\"lib\" -DCMAKE_INSTALL_LIBEXECDIR=\"libexec\" -DGO_VERSION=\"\" -DGO_VERSION_MIN=\"1.23\" -DHAS_COREDUMP=\"ON\" -DHAS_DUMMY=\"ON\" -DHAS_DYNAMICLOAD=\"ON\" -DHAS_MULTIPROTOCOL=\"ON\" -DHAS_TELEGRAM=\"ON\" -D_XOPEN_SOURCE_EXTENDED -I/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/common/src -I/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/ncutil/src -I/opt/local/include -I/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/duchat/src -I/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src -I/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/ncutil/ext/QR-Code-generator/cpp -I/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/ncutil/ext/stb -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -std=gnu++14 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.15 -Wall -Wextra -Wpedantic -Wshadow -Wpointer-arith                        -Wcast-qual -Wno-missing-braces -Wswitch-default                        -Wunreachable-code -Wundef -Wuninitialized                        -Wcast-align -D_DARWIN_C_SOURCE -DNCURSES_WIDECHAR -I/opt/local/include -MD -MT CMakeFiles/nchat.dir/src/uiview.cpp.o -MF CMakeFiles/nchat.dir/src/uiview.cpp.o.d -o CMakeFiles/nchat.dir/src/uiview.cpp.o -c /opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/src/uiview.cpp
/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:963:41: error: no viable overloaded '='
  963 |             message_content->animation_ = td::td_api::make_object<td::td_api::inputFileLocal>(fileInfo.filePath);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:101:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'const unique_ptr<td::td_api::inputAnimation>' for 1st argument
  101 |   unique_ptr &operator=(const unique_ptr &) = delete;
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:104:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'unique_ptr<td::td_api::inputAnimation>' for 1st argument
  104 |   unique_ptr &operator=(unique_ptr &&other) noexcept {
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:120:15: note: candidate template ignored: requirement 'std::is_base_of<td::td_api::inputAnimation, td::td_api::inputFileLocal>::value' was not satisfied [with S = td::td_api::inputFileLocal]
  120 |   unique_ptr &operator=(unique_ptr<S> &&other) noexcept {
      |               ^
/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:969:37: error: no viable overloaded '='
  969 |             message_content->audio_ = td::td_api::make_object<td::td_api::inputFileLocal>(fileInfo.filePath);
      |             ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:101:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'const unique_ptr<td::td_api::inputAudio>' for 1st argument
  101 |   unique_ptr &operator=(const unique_ptr &) = delete;
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:104:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'unique_ptr<td::td_api::inputAudio>' for 1st argument
  104 |   unique_ptr &operator=(unique_ptr &&other) noexcept {
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:120:15: note: candidate template ignored: requirement 'std::is_base_of<td::td_api::inputAudio, td::td_api::inputFileLocal>::value' was not satisfied [with S = td::td_api::inputFileLocal]
  120 |   unique_ptr &operator=(unique_ptr<S> &&other) noexcept {
      |               ^
/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:976:37: error: no viable overloaded '='
  976 |             message_content->video_ = td::td_api::make_object<td::td_api::inputFileLocal>(fileInfo.filePath);
      |             ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:101:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'const unique_ptr<td::td_api::inputVideo>' for 1st argument
  101 |   unique_ptr &operator=(const unique_ptr &) = delete;
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:104:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'unique_ptr<td::td_api::inputVideo>' for 1st argument
  104 |   unique_ptr &operator=(unique_ptr &&other) noexcept {
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:120:15: note: candidate template ignored: requirement 'std::is_base_of<td::td_api::inputVideo, td::td_api::inputFileLocal>::value' was not satisfied [with S = td::td_api::inputFileLocal]
  120 |   unique_ptr &operator=(unique_ptr<S> &&other) noexcept {
      |               ^
/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:983:37: error: no viable overloaded '='
  983 |             message_content->photo_ = td::td_api::make_object<td::td_api::inputFileLocal>(fileInfo.filePath);
      |             ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:101:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'const unique_ptr<td::td_api::inputPhoto>' for 1st argument
  101 |   unique_ptr &operator=(const unique_ptr &) = delete;
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:104:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'unique_ptr<td::td_api::inputPhoto>' for 1st argument
  104 |   unique_ptr &operator=(unique_ptr &&other) noexcept {
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:120:15: note: candidate template ignored: requirement 'std::is_base_of<td::td_api::inputPhoto, td::td_api::inputFileLocal>::value' was not satisfied [with S = td::td_api::inputFileLocal]
  120 |   unique_ptr &operator=(unique_ptr<S> &&other) noexcept {
      |               ^
/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:990:40: error: no viable overloaded '='
  990 |             message_content->document_ = td::td_api::make_object<td::td_api::inputFileLocal>(fileInfo.filePath);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:101:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'const unique_ptr<td::td_api::inputDocument>' for 1st argument
  101 |   unique_ptr &operator=(const unique_ptr &) = delete;
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:104:15: note: candidate function not viable: no known conversion from 'unique_ptr<td::td_api::inputFileLocal>' to 'unique_ptr<td::td_api::inputDocument>' for 1st argument
  104 |   unique_ptr &operator=(unique_ptr &&other) noexcept {
      |               ^         ~~~~~~~~~~~~~~~~~~
/opt/local/include/td/tl/TlObject.h:120:15: note: candidate template ignored: requirement 'std::is_base_of<td::td_api::inputDocument, td::td_api::inputFileLocal>::value' was not satisfied [with S = td::td_api::inputFileLocal]
  120 |   unique_ptr &operator=(unique_ptr<S> &&other) noexcept {
      |               ^
/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:3303:25: error: no member named 'live_period_' in 'td::td_api::messageLocation'
 3303 |     if (messageLocation.live_period_ == 0)
      |         ~~~~~~~~~~~~~~~ ^
In file included from /opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:21:
In file included from /opt/local/include/td/telegram/Client.h:11:
/opt/local/include/td/telegram/td_api.h:77:31: error: no matching constructor for initialization of 'td::td_api::addProxy'
   77 |   return object_ptr<Type>(new Type(std::forward<Args>(args)...));
      |                               ^    ~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/nchat-1624d231/work/nchat-5.15.26/lib/tgchat/src/tgchat.cpp:1791:29: note: in instantiation of function template specialization 'td::td_api::make_object<td::td_api::addProxy, td::tl::unique_ptr<td::td_api::proxy>, const bool &>' requested here
 1791 |       SendQuery(td::td_api::make_object<td::td_api::addProxy>(
      |                             ^
/opt/local/include/td/telegram/td_api.h:92344:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
 92344 | class addProxy final : public Function {
       |       ^~~~~~~~
/opt/local/include/td/telegram/td_api.h:92344:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
 92344 | class addProxy final : public Function {
       |       ^~~~~~~~
/opt/local/include/td/telegram/td_api.h:92377:3: note: candidate constructor not viable: requires 3 arguments, but 2 were provided
 92377 |   addProxy(object_ptr<proxy> &&proxy_, bool enable_, string const &comment_);
       |   ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/td/telegram/td_api.h:92366:3: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
 92366 |   addProxy();
       |   ^
7 errors generated.
make[2]: *** [lib/tgchat/CMakeFiles/tgchat.dir/src/tgchat.cpp.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/nchat-1624d231/work/build'
make[1]: *** [lib/tgchat/CMakeFiles/tgchat.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

How to reproduce it:
Try building against external tdlib.

Environment:

  • Version: nchat 5.15.26, tdlib 1.8.65
  • OS / distro: macOS 10.15.8

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions