<i id='xzHjs'><tr id='xzHjs'><dt id='xzHjs'><q id='xzHjs'><span id='xzHjs'><b id='xzHjs'><form id='xzHjs'><ins id='xzHjs'></ins><ul id='xzHjs'></ul><sub id='xzHjs'></sub></form><legend id='xzHjs'></legend><bdo id='xzHjs'><pre id='xzHjs'><center id='xzHjs'></center></pre></bdo></b><th id='xzHjs'></th></span></q></dt></tr></i><div id='xzHjs'><tfoot id='xzHjs'></tfoot><dl id='xzHjs'><fieldset id='xzHjs'></fieldset></dl></div>
    <bdo id='xzHjs'></bdo><ul id='xzHjs'></ul>

    1. <legend id='xzHjs'><style id='xzHjs'><dir id='xzHjs'><q id='xzHjs'></q></dir></style></legend>
        <tfoot id='xzHjs'></tfoot>

      1. <small id='xzHjs'></small><noframes id='xzHjs'>

      2. 在 raspberry 中交叉编译的 qt 中构建应用程序时出错

        时间:2023-12-03
        <i id='SW6Hi'><tr id='SW6Hi'><dt id='SW6Hi'><q id='SW6Hi'><span id='SW6Hi'><b id='SW6Hi'><form id='SW6Hi'><ins id='SW6Hi'></ins><ul id='SW6Hi'></ul><sub id='SW6Hi'></sub></form><legend id='SW6Hi'></legend><bdo id='SW6Hi'><pre id='SW6Hi'><center id='SW6Hi'></center></pre></bdo></b><th id='SW6Hi'></th></span></q></dt></tr></i><div id='SW6Hi'><tfoot id='SW6Hi'></tfoot><dl id='SW6Hi'><fieldset id='SW6Hi'></fieldset></dl></div>

        <small id='SW6Hi'></small><noframes id='SW6Hi'>

            • <bdo id='SW6Hi'></bdo><ul id='SW6Hi'></ul>

                  <tbody id='SW6Hi'></tbody>
                • <legend id='SW6Hi'><style id='SW6Hi'><dir id='SW6Hi'><q id='SW6Hi'></q></dir></style></legend>

                  <tfoot id='SW6Hi'></tfoot>
                  本文介绍了在 raspberry 中交叉编译的 qt 中构建应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 raspberry pi 中的交叉编译 qt5 上构建和应用程序.此应用程序基于此 rf24l01 库.当我从 RPi 编译 cpp 程序时,一切正常,但是当我从运行 ubuntu 12.04 (32bits) 的电脑上尝试时,出现以下错误:

                  I'm trying to build and app on a cross-compiled qt5 in a raspberry pi. This app is based on this rf24l01 library. When I compile a cpp program from the RPi, everything works fine, but when I tried from my pc running ubuntu 12.04 (32bits) the following error is through:

                  error: cannot find -lrf24-bcm
                  

                  我使用 pro 文件中的这一行指向库:

                  I point to the library using this line in the pro file:

                  LIBS += -L/mnt/rpi/usr/local/lib -lrf24-bcm
                  

                  AFAIK,这是lib所在的路径:

                  AFAIK, this is the path where the lib is located:

                  这是`ls/mnt/rpi/usr/local/lib的结果:

                  This is the result of `ls /mnt/rpi/usr/local/lib:

                  librf24-bcm.so      libwiringPiDev.so      libwiringPi.so.2.0
                  librf24-bcm.so.1    libwiringPiDev.so.2.0  python2.6
                  librf24-bcm.so.1.0  libwiringPi.so         python2.7
                  

                  最后,这是出现的错误详情:

                  Finally, this is the appeared error in detail:

                  /home/atron/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-
                  link,/mnt/rpi/opt/vc/lib -Wl,-rpath-link,/mnt/rpi/usr/lib/arm-linux-gnueabihf -Wl,-rpath-
                  link,/mnt/rpi/lib/arm-linux-gnueabihf --sysroot=/mnt/rpi -Wl,-rpath,/usr/local/opt/lib -o homekit main.o -L/mnt/rpi/usr/local/lib -lrf24-bcm -L/mnt/rpi/usr/本地/opt/lib -lQt5Network -L/usr/local/opt/lib -lQt5Core -lpthread
                  /home/atron/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: 找不到 -lrf24-bcm
                  collect2:错误:ld 返回 1 个退出状态

                  /home/atron/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-
                  link,/mnt/rpi/opt/vc/lib -Wl,-rpath-link,/mnt/rpi/usr/lib/arm-linux-gnueabihf -Wl,-rpath-
                  link,/mnt/rpi/lib/arm-linux-gnueabihf --sysroot=/mnt/rpi -Wl,-rpath,/usr/local/opt/lib -o homekit main.o -L/mnt/rpi/usr/local/lib -lrf24-bcm -L/mnt/rpi/usr/local/opt/lib -lQt5Network -L/usr/local/opt/lib -lQt5Core -lpthread
                  /home/atron/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lrf24-bcm
                  collect2: error: ld returned 1 exit status

                  我做错了什么?

                  提前致谢,

                  推荐答案

                  我不知道这在技术上"是否正确,但解决了我的问题.主要思想是创建库的符号链接到我的 pc /usr/local/lib 文件夹:

                  I don't know if this is "technically" correct, but solved my problem. The main idea is create a symbolic link of the library to my pc /usr/local/lib folder:

                  sudo ln -s /mnt/rpi/usr/local/lib/librf24-bcm.so /usr/local/lib/librf24-bcm.so
                  sudo ln -s /mnt/rpi/usr/local/lib/librf24-bcm.so.1 /usr/local/lib/librf24-bcm.so.1
                  sudo ln -s /mnt/rpi/usr/local/lib/librf24-bcm.so.1.0 /usr/local/lib/librf24-bcm.so.1.0
                  

                  然后,在 QT creator *pro 文件上你只需要添加 lib 引用:

                  Then, on QT creator *pro file you only need to add the lib reference:

                  LIBS=-lrf24-bcm
                  

                  我希望这可以帮助像我这样的新手.问候,

                  I hope this could help to some newbie like me. Regards,

                  这篇关于在 raspberry 中交叉编译的 qt 中构建应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:树莓派上的 Libtorch 无法加载 pt 文件,但可以在 ubuntu 上工作 下一篇:从 C++ 发送 midi 消息

                  相关文章

                  <tfoot id='lUI88'></tfoot>

                • <small id='lUI88'></small><noframes id='lUI88'>

                    1. <legend id='lUI88'><style id='lUI88'><dir id='lUI88'><q id='lUI88'></q></dir></style></legend>
                      • <bdo id='lUI88'></bdo><ul id='lUI88'></ul>
                      <i id='lUI88'><tr id='lUI88'><dt id='lUI88'><q id='lUI88'><span id='lUI88'><b id='lUI88'><form id='lUI88'><ins id='lUI88'></ins><ul id='lUI88'></ul><sub id='lUI88'></sub></form><legend id='lUI88'></legend><bdo id='lUI88'><pre id='lUI88'><center id='lUI88'></center></pre></bdo></b><th id='lUI88'></th></span></q></dt></tr></i><div id='lUI88'><tfoot id='lUI88'></tfoot><dl id='lUI88'><fieldset id='lUI88'></fieldset></dl></div>