I recently upgraded to gcc 6.3 from gcc 5.4. C++ code that used to compile and run just fine stopped compiling and I'm not experienced enough to deduce what is going wrong.
The code is in an object that I created to spawn windows using sfml. It instantiates a thread that uses an sfml::Window pointer to update the image based on an externally set pointer to a video frame.
The code is basic and simple and I'm spawning threads elsewhere in the code (although not threads of an object).
Here are code snippets:
class owindow
{
public:
...
private:
...
std::thread renderThread;
...
void windowRender(void);
...
};
owindow::owindow(std::string name, win_t type, int width, int height, uint32_t *image)
: renderThread()
{
typ = type;
wid = width;
hei = height;
nam = name;
frame = image;
resizewin = false;
killthread = false;
...
window = new sf::Window(sf::VideoMode(windowwidth, windowheight), name.c_str(), sf::Style::Default, settings);
window->setVerticalSyncEnabled(false);
...
void owindow::start(void)
{
// Start the render thread.
renderThread = std::thread(&owindow::windowRender, this);
}
The errors are generated on the renderThread = line shown above (line 174, in error output) are long and brutal and honestly I feel like I'm drowning when I try to understand them. Since when does c++ have tuples? LOL. I'm learning python at work and finally got what a tuple is and then I have this happen...
I just checked, it still compiles and runs with gcc 5.4.
Here are the errors, note this is just the first few errors, I didn't want to spam the forum.
Updated:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple: In instantiation of 'static constexpr bool std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = {const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]':
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:626:248: required by substitution of 'template<class ... _UElements, typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&}; typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> = <missing>]'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/functional:1363:8: required from 'struct std::_Bind_simple<void (*(int, camera*, int*, int*))(int, camera*, int*, int*)>'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/thread:136:55: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (*)(int, camera*, int*, int*); _Args = {int&, camera*, int*&, int*&}]'
/...snip.../ofunctions.hpp:3221:97: required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:483:67: error: mismatched argument pack lengths while expanding 'std::is_constructible<_Elements, _UElements&&>'
return __and_<is_constructible<_Elements, _UElements&&>...>::value;
^~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:484:1: error: body of constexpr function 'static constexpr bool std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = {const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]' not a return-statement
}
^
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple: In instantiation of 'static constexpr bool std::_TC<<anonymous>, _Elements>::_ImplicitlyMoveConvertibleTuple() [with _UElements = {const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]':
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:626:362: required by substitution of 'template<class ... _UElements, typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&}; typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> = <missing>]'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/functional:1363:8: required from 'struct std::_Bind_simple<void (*(int, camera*, int*, int*))(int, camera*, int*, int*)>'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/thread:136:55: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (*)(int, camera*, int*, int*); _Args = {int&, camera*, int*&, int*&}]'
/...snip.../ofunctions.hpp:3221:97: required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:489:65: error: mismatched argument pack lengths while expanding 'std::is_convertible<_UElements&&, _Elements>'
return __and_<is_convertible<_UElements&&, _Elements>...>::value;
^~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:490:1: error: body of constexpr function 'static constexpr bool std::_TC<<anonymous>, _Elements>::_ImplicitlyMoveConvertibleTuple() [with _UElements = {const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]' not a return-statement
}
^
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple: In instantiation of 'static constexpr bool std::_TC<<anonymous>, _Elements>::_NonNestedTuple() [with _SrcTuple = const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]':
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:662:419: required by substitution of 'template<class ... _UElements, class _Dummy, typename std::enable_if<((std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ConstructibleTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyConvertibleTuple<_UElements ...>()) && std::_TC<(std::is_same<_Dummy, void>::value && (1ul == 1)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NonNestedTuple<const tuple<_Elements ...>&>()), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(const std::tuple<_Args1 ...>&) [with _UElements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}; _Dummy = void; typename std::enable_if<((std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ConstructibleTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyConvertibleTuple<_UElements ...>()) && std::_TC<(std::is_same<_Dummy, void>::value && (1ul == 1)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NonNestedTuple<const tuple<_Elements ...>&>()), bool>::type <anonymous> = <missing>]'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/functional:1363:8: required from 'struct std::_Bind_simple<void (*(int, camera*, int*, int*))(int, camera*, int*, int*)>'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/thread:136:55: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (*)(int, camera*, int*, int*); _Args = {int&, camera*, int*&, int*&}]'
/...snip.../ofunctions.hpp:3221:97: required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:495:244: error: wrong number of template arguments (6, should be 2)
return __and_<__not_<is_same<tuple<_Elements...>,
^
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/type_traits:1558:8: note: provided for 'template<class _From, class _To> struct std::is_convertible'
struct is_convertible
^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:502:1: error: body of constexpr function 'static constexpr bool std::_TC<<anonymous>, _Elements>::_NonNestedTuple() [with _SrcTuple = const std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]' not a return-statement
}
^
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple: In instantiation of 'static constexpr bool std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = {std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]':
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:626:248: required by substitution of 'template<class ... _UElements, typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>}; typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> = <missing>]'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/functional:1363:8: required from 'struct std::_Bind_simple<void (*(int, camera*, int*, int*))(int, camera*, int*, int*)>'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/thread:136:55: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (*)(int, camera*, int*, int*); _Args = {int&, camera*, int*&, int*&}]'
/...snip.../ofunctions.hpp:3221:97: required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:483:67: error: mismatched argument pack lengths while expanding 'std::is_constructible<_Elements, _UElements&&>'
return __and_<is_constructible<_Elements, _UElements&&>...>::value;
^~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:484:1: error: body of constexpr function 'static constexpr bool std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = {std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]' not a return-statement
}
^
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple: In instantiation of 'static constexpr bool std::_TC<<anonymous>, _Elements>::_ImplicitlyMoveConvertibleTuple() [with _UElements = {std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]':
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:626:362: required by substitution of 'template<class ... _UElements, typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>}; typename std::enable_if<(((std::_TC<(sizeof... (_UElements) == 1), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NotSameTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>()) && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && (5ul >= 1)), bool>::type <anonymous> = <missing>]'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/functional:1363:8: required from 'struct std::_Bind_simple<void (*(int, camera*, int*, int*))(int, camera*, int*, int*)>'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/thread:136:55: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (*)(int, camera*, int*, int*); _Args = {int&, camera*, int*&, int*&}]'
/...snip.../ofunctions.hpp:3221:97: required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:489:65: error: mismatched argument pack lengths while expanding 'std::is_convertible<_UElements&&, _Elements>'
return __and_<is_convertible<_UElements&&, _Elements>...>::value;
^~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:490:1: error: body of constexpr function 'static constexpr bool std::_TC<<anonymous>, _Elements>::_ImplicitlyMoveConvertibleTuple() [with _UElements = {std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>}; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]' not a return-statement
}
^
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple: In instantiation of 'static constexpr bool std::_TC<<anonymous>, _Elements>::_NonNestedTuple() [with _SrcTuple = std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&&; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]':
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:686:422: required by substitution of 'template<class ... _UElements, class _Dummy, typename std::enable_if<((std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && std::_TC<(std::is_same<_Dummy, void>::value && (1ul == 1)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NonNestedTuple<tuple<_Elements ...>&&>()), bool>::type <anonymous> > constexpr std::tuple< <template-parameter-1-1> >::tuple(std::tuple<_Args1 ...>&&) [with _UElements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}; _Dummy = void; typename std::enable_if<((std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_MoveConstructibleTuple<_UElements ...>() && std::_TC<(1ul == sizeof... (_UElements)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) && std::_TC<(std::is_same<_Dummy, void>::value && (1ul == 1)), void (*)(int, camera*, int*, int*), int, camera*, int*, int*>::_NonNestedTuple<tuple<_Elements ...>&&>()), bool>::type <anonymous> = <missing>]'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/functional:1363:8: required from 'struct std::_Bind_simple<void (*(int, camera*, int*, int*))(int, camera*, int*, int*)>'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/thread:136:55: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (*)(int, camera*, int*, int*); _Args = {int&, camera*, int*&, int*&}]'
/...snip.../ofunctions.hpp:3221:97: required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:495:244: error: wrong number of template arguments (6, should be 2)
return __and_<__not_<is_same<tuple<_Elements...>,
^
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/type_traits:1558:8: note: provided for 'template<class _From, class _To> struct std::is_convertible'
struct is_convertible
^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/tuple:502:1: error: body of constexpr function 'static constexpr bool std::_TC<<anonymous>, _Elements>::_NonNestedTuple() [with _SrcTuple = std::tuple<void (*)(int, camera*, int*, int*), int, camera*, int*, int*>&&; bool <anonymous> = true; _Elements = {void (*)(int, camera*, int*, int*), int, camera*, int*, int*}]' not a return-statement
}
^
CMake Error at ocapture_generated_ocapture.cu.o.cmake:282 (message):
Error generating file
/...snip.../build/CMakeFiles/ocapture.dir//./ocapture_generated_ocapture.cu.o
make[2]: *** [CMakeFiles/ocapture.dir/build.make:510: CMakeFiles/ocapture.dir/ocapture_generated_ocapture.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:67: CMakeFiles/ocapture.dir/all] Error 2
make: *** [Makefile:84: all] Error 2