Cross-compilation errors with std::async












2














Background




  1. I built a toolchain for my ARMv7 Raspberry Pi using crosstool-ng on my Ubuntu 18.04. Due to a problem with GCC 7.1 compilation of GCC 6.3.0 I did some modifications to ubsan.c file.

  2. I built the required libraries on the Raspberry Pi itself, used the symlink utility to change symlinks from absolute to relative, compressed the /usr and /lib directories for transfer and installed them in my working sysroot directory.

  3. This toolchain has been shown to work for a number of large projects.


The problem



I have built a simple application using the paho.mqtt.cpp library. This application uses the C++11 standard, as required by the library. The application compiles and executes when compiled on my development machine and also when compiled on the Raspberry Pi. However, when I use the abovementioned toolchain, I get an error related to the library's use of std::async.



In file included from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:0:
/opt/pi/sysroot/usr/local/include/mqtt/client.h: In member function 'virtual void mqtt::client::connected(const string&)':
/opt/pi/sysroot/usr/local/include/mqtt/client.h:71:76: error: invalid use of incomplete type 'class std::future<void>'
std::async(std::launch::async, &callback::connected, userCallback_, cause);
^
In file included from /opt/pi/sysroot/usr/local/include/mqtt/client.h:28:0,
from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:
/opt/pi/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/include/c++/6.3.1/future:115:11: note: declaration of 'class std::future<void>'
class future;
^~~~~~


Attempted fixes




  1. I tried using the -nostdinc flag to stop the compiler from using its standard headers and use the ones in the sysroot. The error persisted.

  2. I have tried replacing the future file referred to in the error with the one installed in the Pi (it only has a very minor difference). The error persisted.


My question



Would anyone be able to give an indication to the cause of this error and possible things to look into? Should I try to rebuild the toolchain differently or perhaps I am missing some flags?










share|improve this question






















  • The source of the problem has been confirmed to be the cross-compiler. An old colleague of mine gave me his cross-compiler which he built on his machine and it worked fine. I will try to find time to rebuild the cross-compiler to figure out what the exact issue is. I suspect it may be caused due to problems in compiling GCC 6.3 with GCC 7.1.
    – William Hicklin
    Nov 29 '18 at 10:00
















2














Background




  1. I built a toolchain for my ARMv7 Raspberry Pi using crosstool-ng on my Ubuntu 18.04. Due to a problem with GCC 7.1 compilation of GCC 6.3.0 I did some modifications to ubsan.c file.

  2. I built the required libraries on the Raspberry Pi itself, used the symlink utility to change symlinks from absolute to relative, compressed the /usr and /lib directories for transfer and installed them in my working sysroot directory.

  3. This toolchain has been shown to work for a number of large projects.


The problem



I have built a simple application using the paho.mqtt.cpp library. This application uses the C++11 standard, as required by the library. The application compiles and executes when compiled on my development machine and also when compiled on the Raspberry Pi. However, when I use the abovementioned toolchain, I get an error related to the library's use of std::async.



In file included from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:0:
/opt/pi/sysroot/usr/local/include/mqtt/client.h: In member function 'virtual void mqtt::client::connected(const string&)':
/opt/pi/sysroot/usr/local/include/mqtt/client.h:71:76: error: invalid use of incomplete type 'class std::future<void>'
std::async(std::launch::async, &callback::connected, userCallback_, cause);
^
In file included from /opt/pi/sysroot/usr/local/include/mqtt/client.h:28:0,
from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:
/opt/pi/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/include/c++/6.3.1/future:115:11: note: declaration of 'class std::future<void>'
class future;
^~~~~~


Attempted fixes




  1. I tried using the -nostdinc flag to stop the compiler from using its standard headers and use the ones in the sysroot. The error persisted.

  2. I have tried replacing the future file referred to in the error with the one installed in the Pi (it only has a very minor difference). The error persisted.


My question



Would anyone be able to give an indication to the cause of this error and possible things to look into? Should I try to rebuild the toolchain differently or perhaps I am missing some flags?










share|improve this question






















  • The source of the problem has been confirmed to be the cross-compiler. An old colleague of mine gave me his cross-compiler which he built on his machine and it worked fine. I will try to find time to rebuild the cross-compiler to figure out what the exact issue is. I suspect it may be caused due to problems in compiling GCC 6.3 with GCC 7.1.
    – William Hicklin
    Nov 29 '18 at 10:00














2












2








2







Background




  1. I built a toolchain for my ARMv7 Raspberry Pi using crosstool-ng on my Ubuntu 18.04. Due to a problem with GCC 7.1 compilation of GCC 6.3.0 I did some modifications to ubsan.c file.

  2. I built the required libraries on the Raspberry Pi itself, used the symlink utility to change symlinks from absolute to relative, compressed the /usr and /lib directories for transfer and installed them in my working sysroot directory.

  3. This toolchain has been shown to work for a number of large projects.


The problem



I have built a simple application using the paho.mqtt.cpp library. This application uses the C++11 standard, as required by the library. The application compiles and executes when compiled on my development machine and also when compiled on the Raspberry Pi. However, when I use the abovementioned toolchain, I get an error related to the library's use of std::async.



In file included from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:0:
/opt/pi/sysroot/usr/local/include/mqtt/client.h: In member function 'virtual void mqtt::client::connected(const string&)':
/opt/pi/sysroot/usr/local/include/mqtt/client.h:71:76: error: invalid use of incomplete type 'class std::future<void>'
std::async(std::launch::async, &callback::connected, userCallback_, cause);
^
In file included from /opt/pi/sysroot/usr/local/include/mqtt/client.h:28:0,
from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:
/opt/pi/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/include/c++/6.3.1/future:115:11: note: declaration of 'class std::future<void>'
class future;
^~~~~~


Attempted fixes




  1. I tried using the -nostdinc flag to stop the compiler from using its standard headers and use the ones in the sysroot. The error persisted.

  2. I have tried replacing the future file referred to in the error with the one installed in the Pi (it only has a very minor difference). The error persisted.


My question



Would anyone be able to give an indication to the cause of this error and possible things to look into? Should I try to rebuild the toolchain differently or perhaps I am missing some flags?










share|improve this question













Background




  1. I built a toolchain for my ARMv7 Raspberry Pi using crosstool-ng on my Ubuntu 18.04. Due to a problem with GCC 7.1 compilation of GCC 6.3.0 I did some modifications to ubsan.c file.

  2. I built the required libraries on the Raspberry Pi itself, used the symlink utility to change symlinks from absolute to relative, compressed the /usr and /lib directories for transfer and installed them in my working sysroot directory.

  3. This toolchain has been shown to work for a number of large projects.


The problem



I have built a simple application using the paho.mqtt.cpp library. This application uses the C++11 standard, as required by the library. The application compiles and executes when compiled on my development machine and also when compiled on the Raspberry Pi. However, when I use the abovementioned toolchain, I get an error related to the library's use of std::async.



In file included from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:0:
/opt/pi/sysroot/usr/local/include/mqtt/client.h: In member function 'virtual void mqtt::client::connected(const string&)':
/opt/pi/sysroot/usr/local/include/mqtt/client.h:71:76: error: invalid use of incomplete type 'class std::future<void>'
std::async(std::launch::async, &callback::connected, userCallback_, cause);
^
In file included from /opt/pi/sysroot/usr/local/include/mqtt/client.h:28:0,
from /home/hicklin/CLionProjects/mqttTest/main.cpp:7:
/opt/pi/x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/include/c++/6.3.1/future:115:11: note: declaration of 'class std::future<void>'
class future;
^~~~~~


Attempted fixes




  1. I tried using the -nostdinc flag to stop the compiler from using its standard headers and use the ones in the sysroot. The error persisted.

  2. I have tried replacing the future file referred to in the error with the one installed in the Pi (it only has a very minor difference). The error persisted.


My question



Would anyone be able to give an indication to the cause of this error and possible things to look into? Should I try to rebuild the toolchain differently or perhaps I am missing some flags?







c++ arm cross-compiling stdasync






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 12:47









William Hicklin

214




214












  • The source of the problem has been confirmed to be the cross-compiler. An old colleague of mine gave me his cross-compiler which he built on his machine and it worked fine. I will try to find time to rebuild the cross-compiler to figure out what the exact issue is. I suspect it may be caused due to problems in compiling GCC 6.3 with GCC 7.1.
    – William Hicklin
    Nov 29 '18 at 10:00


















  • The source of the problem has been confirmed to be the cross-compiler. An old colleague of mine gave me his cross-compiler which he built on his machine and it worked fine. I will try to find time to rebuild the cross-compiler to figure out what the exact issue is. I suspect it may be caused due to problems in compiling GCC 6.3 with GCC 7.1.
    – William Hicklin
    Nov 29 '18 at 10:00
















The source of the problem has been confirmed to be the cross-compiler. An old colleague of mine gave me his cross-compiler which he built on his machine and it worked fine. I will try to find time to rebuild the cross-compiler to figure out what the exact issue is. I suspect it may be caused due to problems in compiling GCC 6.3 with GCC 7.1.
– William Hicklin
Nov 29 '18 at 10:00




The source of the problem has been confirmed to be the cross-compiler. An old colleague of mine gave me his cross-compiler which he built on his machine and it worked fine. I will try to find time to rebuild the cross-compiler to figure out what the exact issue is. I suspect it may be caused due to problems in compiling GCC 6.3 with GCC 7.1.
– William Hicklin
Nov 29 '18 at 10:00

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338245%2fcross-compilation-errors-with-stdasync%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338245%2fcross-compilation-errors-with-stdasync%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents