qt - 为 Pandaboard 交叉编译 Qt

标签 qt ubuntu arm cross-compiling pandaboard

我花了数周时间尝试为我的 Panda 板交叉编译 Qt,但没办法,我无法通过 ./configure。如果有人能给我帮助,我将不胜感激。

我的主机系统是 Ubuntu-13.04 ×86_64bit(运行 un Virtualbox)

我的目标系统是 Pandaboard ES Ubuntu-12.04。

主机箱中的所有步骤:

sudo apt-get install arm-linux-gnueabihf

sudo mkdir /opt/qt-485-armhf

cd /usr/src

sudo wget http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz

sudo tar xf qt-everywhere-opensource-src-4.8.5.tar.gz

cd /usr/src/qt-everywhere-opensource-src-4.8.5

sudo cp -r mkspecs/qws/linux-arm-gnueabi-g++ mkspecs/qws/linux-arm-gnueabihf-g++

sudo vim mkspecs/qws/linux-arm-gnueabihf-g++/qmake.conf
-------------------------------
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

#Compiler Flags to take advantage of the ARM architecture
#N.B.:I also tried to uncomment the two following instructions with no success   
QMAKE_CFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
QMAKE_CXXFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard

# modifications to g++.conf
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_STRIP             = arm-linux-gnueabihf-strip

load(qt_config)
---------------------------------

sudo sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" config.tests/unix/libmng/libmng.cpp (This command fixes detection of libmng 2.0.)
export QTDIR=/opt/qt4-485-armhf
And finally:
sudo ./configure -prefix /opt/qt4-485-armhf -sysconfdir /etc/xdg -embedded arm -little-endian -host-big-endian -no-qt3support -nomake examples -nomake demos -opensource -confirm-license -release -openssl-linked -no-phonon -no-phonon-backend -no-nis -platform qws/linux-x86_64-g++ -xplatform qws/linux-arm-gnueabihf-g++ -optimized-qmake

With this result:
Creating qmake. Please wait...
g++ -c -o option.o -pipe -m64 -DQMAKE_OPENSOURCE_EDITION -O2 -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerators/integrity -I/usr/src/qt-everywhere-opensource-src-4.8.5/include -I/usr/src/qt-everywhere-opensource-src-4.8.5/include/QtCore -I/usr/src/qt-everywhere-opensource-src-4.8.5/src/corelib/global -I/usr/src/qt-everywhere-opensource-src-4.8.5/src/corelib/xml -I/usr/src/qt-everywhere-opensource-src-4.8.5/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/usr/src/qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-x86_64-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED  option.cpp
g++ -o "/usr/src/qt-everywhere-opensource-src-4.8.5/bin/qmake" project.o property.o main.o makefile.o unixmake2.o unixmake.o mingw_make.o option.o winmakefile.o projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfile.o qfilesystementry.o qfilesystemengine_unix.o qfilesystemengine.o qfilesystemiterator_unix.o qfsfileengine_unix.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o  


You have not explicitly asked to use pkg-config and are cross-compiling.
pkg-config will not be used to automatically query cflag/lib parameters for
dependencies


The system floating point format could not be detected.
This may cause data to be generated in a wrong format
Turn on verbose messaging (-v) to see the final report.
OpenSSL support cannot be enabled due to functionality tests!
 Turn on verbose messaging (-v) to ./configure to see the final report.
 If you believe this message is in error you may use the continue
 switch (-continue) to ./configure to continue.

提前致谢。

最佳答案

要在PC 上交叉编译一个程序,您必须在PC 上安装相同包的开发 文件作为< em>ARM 目标。 Qt 4.8 依赖于 OpenSSL,因此如果您希望编译 QtARM 版本获取正确的开发文件em>.

  1. 安装 Ubuntu 12.04 PC 虚拟机。 与董事会的版本相同
  2. 获取编译器。 apt-get install arm-linux-gnueabihf (你知道的)。
  3. 获取required development packages . apt-get install libssl-dev
    apt-get build-dep -aarmhf qt4 (仅适用于 X11)。
  4. 编辑您的 Qt 配置以满足您的需求并构建它。

您缺少的当前步骤是第 3 步;但要执行此操作,您需要第 1 步 或通过其他方式获取适用于 Ubuntu 12.04 的 OpenSSL 开发文件。使用 apt.sources 可能还有其他方法可以做到这一点。我认为上述步骤对您来说最简单。

关于qt - 为 Pandaboard 交叉编译 Qt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19059596/

相关文章:

c++ - 我必须在我的应用程序中包含所有这些 Qt dll 吗?

c++ - 使用 Qt5.3.2 在 Linux 上禁用关闭和最小化按钮

c++ - QThread - 使用 moveToThread 将类成员移动到线程

python - 从 lighttable 运行 python .py,ctrl+shift+enter : nothing happens

Python/feedparser 脚本不会显示在 CGI/字符编码上

c - 为什么GCC在编译C代码时不使用更多寄存器

python - PyQT 自定义小部件固定为正方形

ubuntu - emacs 窗口(框架)在启动时消失

ios - Clang + iOS + 汇编器跳转 : error "unsupported relocation on symbol"

linux - cups arm交叉编译错误: unknown type name ‘gss_OID’