-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake Qt-Cross Not Succeeding #15
Comments
Yes, tutorial is quite old, probably toolchain is out of date. Could you please use like Linaro version 7.5.0 and give it a try. According to your output I can update the page. |
Do you mean using this runtime-gcc-linaro-7.5.0-2019.12-aarch64-linux-gnu.tar.xz instead of the toolchain suggested in the tutorial |
Yes you can try it. (I have not checked yet) but if you are able to find hf(hard float) version it will be better. |
Sorry for the delay, I think I figured out what the problem was. I created an ubuntu docker container that was aarch64 based instead of x86. I used the amd64 docker container and followed the guide you posted and finally successfully configure the qt-cross directory. The next issue now is Im getting some undefined reference errors to |
Update. I tried using this as my toolchain, however im encountering an error during the build process, similar to what I was encountering with the other toolchain
I think im gonna investigate using a more modern toolchain and see if that fixes anything. |
So another failure. Tried using gcc-11 specifically using this as my toolchain
and ended up getting this error, which ive gotten before and it never seems to end up well.
Going to try my hacks ive used before (moving bits, sys, gnu folders outside of the arm-linux folder in the usr/include inside my sysroot, but i have a feeling im going to get the C++-11 missing or not compiled error again |
I was right. get the same two errors
I assume its because I’m not using the correct cross compiler for the target architecture, but as someone whos never cross compiled anything, I have no idea. |
I am not sure what you are doing there, If you use docker or anything else, you can see different errors. I saw before that other people were able to compile it with different version of toolchains. But as I told you toolchain which is in the tutorial is old. |
Which part are you referring to. |
Share your histroy, let me check. |
Like my terminal history? or explain what I’ve done so far? |
Yes terminal history, you can also explain what are you doing. |
ok its pretty big but ill try to break things down for what Ive tried.
Then when that succeeded I ran this command
which resulted in this massive error
So I then tried using the linaro toolchain you recommended
and unzipped it then i modified my toolchain to use this, first clearing the qt-cross directory and simply substituting the toolchain you had for this one, which succeeded yet again in configuring qt
and resulted in a similar error as the other toolchain when i tried to build it
Then i looked up what this was and it recommended doing <experimental/filesystem> so then i changed to the newer version of gcc and then reconfigured my toolchain.cmake file to use this which resulted in the error i just sent when trying to configure qt. Any help would be so unbelievably appreciated. |
I can supply the full success configuration output for your guide’s toolchain because I pretty much am getting to that point with the linaro toolchain if youd like. |
What is your host machine ? have you followed exactly same steps ? Need to see history. It looks like, you make sth different. |
I believe ive followed all the steps exactly right
Heres the configuration output
Attached is the absolute complete terminal output. Its very very long (i may have ran the find command in the root directory :()). Ive tried alot of things |
The error about filesystem/undefined references is about there is a mismatch between toolchain and the cpp version. You should check which cpp version is used for qt version then find the correct toolchain for it. for instance here https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi 6.4 is used, and as you did they install default toolchain. |
Ok yeah I tried following that, Ill retry using gcc-9 instead of 11 then |
Your host is not ubuntu ? |
it should be... the image name is amd64/ubuntu |
Could you please paste lsb_release -a |
|
I tested this toolchain with 6.3(qt). But as I see you try to use 6.6. That means you do not follow exactly same. Maybe I should have told this in the video or readme about the mismatch. You should find the correct toolchain for your qt version. And probably some flags are needed to be set from cmake. |
Try exactly same here. Use 6.4. |
Ok, I believe I tried using 6.3 before but i remember getting a similar error, but I think I was on the wrong docker container then. Ill try both. Thank you for helping me out I’ve been banging my head against the wall for a while. Ill let you know if 6.3 or 6.4 works. |
You can see some errors also, I can try it myself to be sure but I do not have time nowadays. Try and see. Use clean ubuntu plase. As I told you, it is highly possible that you can see some erros, but lets see. |
Yes because 6.3 is deleted. you can use 6.5, but as I see you should be able to checkout to specific version as they do in their tutorial. (for 6.4) If you check this link https://download.qt.io/official_releases/qt/ you will see available versions. I need to update the page probably, thanks to point out. |
Ok, just for clarity, Im going to first try following your guide exactly, using 6.3 instead of 6.6. On a brand new amd64/ubuntu image docker container. Again I really really appreciate the time youre giving me. |
No you should follow the tutorial they provided. It looks more up to date. Use 6.4. Please try exaclty same steps. Why do you need docker image ? Some packages can be missing there? Create a new ubuntu virtual machine, then follow same steps. When you have working qt then you can play with docker. |
Ok, I wont be able to complete this until Monday, as I dont have access to the pi that Im deploying on until then unfortunately. Will let you now how it goes. |
So I finally was able to get the files off the pi again. However I was wondering if you wanted me to build cmake from source or apt install it as its not specified in the guide. Ive done both and building it from source has gotten me further in the past. |
If the default one is working the go for it. But as you said, try both. |
Sorry for the delay, I had to figure out how to resize my vm which resulted in me just deleting it and then remaking one with a bigger disk, which required me to reget all the files off the pi again. When I follow the instructions exactly (with slight modifications based off the discussions tab of the post) I get this error,
The only thing that is different is that this command |
Do you have this file libc-header-start.h ? in your system ? Can you search it. |
Yes its inside arm-linux-gnueabihf/bits |
Then defining path is a problem. include_directories(/path/to/arm-linux-gnueabihf/bits) |
You should update each path accordingly. If cmake can not fınd sth then it is also problem |
well arent those for installation? I’m not entirely sure what they are doing. But if I include the directory by adding -I{TARGET_SYSROOT}/usr/include/arm-linux-gnueabihf to the Cflag I get passed that error and to this one
Which is something ive gotten before because inside that arm-linux-gnueabihf it doesnt have a stubs-soft.h it just has stub-hard.h |
For qt 6.5.1 they use gcc 10.3.0, binutils 2.35.2, glibc 2.31
Copy kernel headers
Edit gcc-10.3.0/libsanitizer/asan/asan_linux.cpp. Add following piece of code.
Compile
I will try this myself when I find time. |
And also there is pre compiled toolchains here https://github.com/abhiTronix/raspberry-pi-cross-compilers you can give it a try, first try from here |
I assume Id have to change my toolchain.cmake file as well for this right? |
You should update CMAKE_C_COMPILER and CMAKE_CXX_COMPILER I think. I compiled gcc, and I am able to compile qt 6.6.1 for rasp 4. (I tried only base). I will share soon only commands. I am going to close this thread ? In the steps that I shared there is a mistake, kernel should be 8 not 7. I took reference this page https://docs.slackware.com/howtos:hardware:arm:gcc-10.x_aarch64_cross-compiler I recommend you to check also. |
Sounds good, we actually ended up using buildroot as a workaround and got it compiling that way this past week. |
With buildroot ? You created the image which has qt already ? |
we just added the libraries we needed for the application and then compiled the binaries using the image. |
Do you have steps ? or any link for refenrece ? |
Another team member was investigating build root so once he documents his steps I will link that here, I do not know the specific steps as I was focused on trying to cross compile. |
Thanks, it will be good for people who searchs about the topic. Then I will keep this thread open until you share it :) |
Yes It would also be awesome to be able to know how to cross compile as the build root is definitely specific to our embedded use case as well. |
I assume an updated guide for cross compilation will be made for the readme? |
I will add new readme for 6.6.1, then I will extend with docker with video tutorial. |
Thats awesome you are a legend! |
Hi, I created a page which shows the details for compilation(6.6.1) with docker. I tested it is working. Link I can update the page later, the video will be available soon. I close this thread. If you share buildroot notes, it will be great for others. |
I’m trying to cmake the qt-cross directory. Ive followed the README up to this point successfully but when i run this command.
I get this output/error
I tried adding the lines suggested in #8, this did not change anything as I’m not using that toolchain I’m using the one specified in the readme.
The text was updated successfully, but these errors were encountered: