mercredi 1 mars 2017

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

I'm trying to compile an example using std::future with arm-linux-gnueabi-g++-4.7 compiler but I have the following errors. what's wrong? In installed the compiler as distribution package.

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

#include iostream
#include future
#include thread
int main()
{
// future from a packaged_task
std::packaged_task task([](){ return 7; }); // wrap the function
}

Aucun commentaire:

Enregistrer un commentaire