I'm trying to cross-compile a large project for the Raspberry Pi. I'm using a toolchain built by crosstool-ng, gcc version 4.7.3. The compilation chokes when it sees std::shared_future. I get this error:
test.cpp:5:27: error: aggregate 'std::shared_future<int> xxx' has incomplete type and cannot be defined
And here's the source file that generates that error:
#include <future>
int main()
{
std::shared_future<int> xxx;
return 0;
}
This same source file compiles successfully on the Rapsberry Pi itself. Is this a bug in the crosstool toolchain? Is there a workaround? How can I get this to successfully compile?
To have shared_future
implementation class and not just the forward declaration, you must have the following preprocessor condition equal to true : #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
&& (ATOMIC_INT_LOCK_FREE > 1)
According to your previous answer to @juanchopanza, it seems that you have the following part of the condition equal to true : if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
because it's necarry to have the implementation of thread
class.
Finaly, we could say that this part of the condition is false ATOMIC_INT_LOCK_FREE > 1
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With