Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation errors on Ubuntu 22.04 #70

Closed
christianrauch opened this issue May 18, 2022 · 1 comment
Closed

compilation errors on Ubuntu 22.04 #70

christianrauch opened this issue May 18, 2022 · 1 comment

Comments

@christianrauch
Copy link

I am getting a couple of compiler (GNU 11.2.0) errors:

In file included from /tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.h:10,
                 from /tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:1:
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:15:33: error: expected unqualified-id before ‘)’ token
   15 |         SingleInstanceFuture<T>() = default;
      |                                 ^
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:21:48: error: invalid declarator before ‘other’
   21 |         SingleInstanceFuture<T>(std::future<T> other);
      |                                                ^~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:21:47: error: expected ‘)’ before ‘other’
   21 |         SingleInstanceFuture<T>(std::future<T> other);
      |                                ~              ^~~~~~
      |                                               )
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:48:8: error: no declaration matches ‘SingleInstanceFuture<T>::SingleInstanceFuture(std::future<_Res>)’
   48 | inline SingleInstanceFuture<T>::SingleInstanceFuture(std::future<T> other) : std::future<T>(std::move(other)) {}
      |        ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:48:8: note: no functions named ‘SingleInstanceFuture<T>::SingleInstanceFuture(std::future<_Res>)’
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:12:7: note: ‘class SingleInstanceFuture<T>’ defined here
   12 | class SingleInstanceFuture : public std::future<T>
      |       ^~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawDeviceDiscovery()::<lambda()>; Args = {}; T = void]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:112:40:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<void>&’ to an rvalue of type ‘std::future<void>’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = void]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~

/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawDeviceDiscovery()::<lambda()>; Args = {}; T = std::vector<BluetoothDevice>]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:146:48:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<std::vector<BluetoothDevice> >&’ to an rvalue of type ‘std::future<std::vector<BluetoothDevice> >’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = std::vector<BluetoothDevice>]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~

/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawASMControls()::<lambda()>; Args = {}; T = int]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:223:41:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<int>&’ to an rvalue of type ‘std::future<int>’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = int]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~

/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::CrossPlatformGUI(BluetoothWrapper)::<lambda()>; Args = {}; T = std::vector<BluetoothDevice>]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:245:44:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<std::vector<BluetoothDevice> >&’ to an rvalue of type ‘std::future<std::vector<BluetoothDevice> >’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = std::vector<BluetoothDevice>]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~
@christianrauch
Copy link
Author

Whoops, duplicate of #51.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant