Marco Sperandini
Marco Sperandini

Reputation: 11

arm-linux-gnueabi-g++-4.7 cross-compiling c++11

I'm trying to compile an example using std::future with arm-linux-nueabi-g++-4.7 compiler; however, I have the following errors:

user@user-virtual-machine:~/projects/prova$ arm-linux-gnueabi-g++-4.7 -pthread -std=c++11 -c main.cpp

main.cpp: In function ‘int main()’:

main.cpp:8:35: error: variable ‘std::packaged_task task’ has initializer but incomplete type

Can someone please tell me what I did wrong? I installed the compiler as distribution package.

code:

#include <iostream>
#include <future>
#include <thread>

int main()
{
    // future from a packaged_task
    std::packaged_task<int()> task([](){ return 7; }); // wrap the function
}

Upvotes: 1

Views: 1040

Answers (1)

zomeck
zomeck

Reputation: 51

I could reproduce the same error on an ubuntu 16.04. Compiling with the following target architecture -march=armv7-a worked. These other architectures armv7-r armv6zk armv6z armv6t2 armv6k also worked (I did not try them all).

It seems for some architectures this code does not compile. I hope your board is suported! :)

Upvotes: 1

Related Questions