• arm-linux-gnueabihf-gcc 5.2编译qt4.8.5


    1、解压

    tar xzvf qt-everywhere-opensource-src-4.8.5.tar.gz

    2、 修改 qmake.conf

    mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf 

    1. #
    2. # qmake configuration for building with arm-none-linux-gnueabi-g++
    3. #
    4. include(../../common/linux.conf)
    5. include(../../common/gcc-base-unix.conf)
    6. include(../../common/g++-unix.conf)
    7. include(../../common/qws.conf)
    8. QMAKE_LIBS_EGL += -lEGL
    9. QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
    10. QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL
    11. IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
    12. QMAKE_CFLAGS += $$IMX6_CFLAGS
    13. QMAKE_CXXFLAGS += $$IMX6_CFLAGS
    14. DISTRO_OPTS += hard-float
    15. # modifications to g++.conf
    16. QMAKE_CC = /opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -lts
    17. QMAKE_CXX = /opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
    18. QMAKE_LINK = /opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
    19. QMAKE_LINK_SHLIB = /opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
    20. # modifications to linux.conf
    21. QMAKE_AR = /opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs
    22. QMAKE_OBJCOPY = /opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy
    23. QMAKE_STRIP = /opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip
    24. load(qt_config)

    3.配置编译项 configure

    1. #!/bin/bash
    2. ./configure -prefix /usr/local/Trolltech/Qt-4.8.5 \
    3. -opensource \
    4. -confirm-license \
    5. -device-option CROSS_COMPILE=/opt/arm-5.2/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
    6. -release -shared \
    7. -embedded arm \
    8. -xplatform qws/linux-arm-gnueabi-g++ \
    9. -fast \
    10. -optimized-qmake \
    11. -no-pch \
    12. -qt-libjpeg \
    13. -qt-zlib \
    14. -qt-libpng \
    15. -qt-freetype \
    16. -little-endian \
    17. -host-little-endian \
    18. -no-qt3support \
    19. -no-libtiff \
    20. -no-libmng \
    21. -no-opengl \
    22. -no-mmx \
    23. -no-sse \
    24. -no-sse2 \
    25. -no-3dnow \
    26. -no-openssl \
    27. -no-webkit \
    28. -no-qvfb \
    29. -no-phonon \
    30. -no-nis \
    31. -no-cups \
    32. -no-glib \
    33. -qt-mouse-tslib \
    34. -nomake tools \
    35. -nomake docs \
    36. -nomake examples \
    37. -qt-sql-sqlite \
    38. -plugin-sql-sqlite \
    39. -rpath \
    40. -v \
    41. -I/home/lyp/workspace/qt/arm-tslib/include \
    42. -L/home/lyp/workspace/qt/arm-tslib/lib

    4.编译及安装

    make

    sudo make install

    遇到问题

     -I../../include/QtCore -I../../include/QtNetwork -I../../include -I../../include/QtGui -I.rcc/release-shared-emb-arm -Iimage -I../3rdparty/libpng -I../3rdparty/zlib -I../3rdparty/zlib -I../3rdparty/freetype/builds/unix -I../3rdparty/freetype/src -I../3rdparty/freetype/include -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-shared-emb-arm -I.uic/release-shared-emb-arm -o .obj/release-shared-emb-arm/qprintdialog_unix.o dialogs/qprintdialog_unix.cpp
    dialogs/qprintdialog_unix.cpp: In destructor 'virtual QPrintPropertiesDialog::~QPrintPropertiesDialog()':
    dialogs/qprintdialog_unix.cpp:281:19: error: 'class Ui::QPrintPropertiesWidget' has no member named 'cupsPropertiesPage'
         delete widget.cupsPropertiesPage;
                       ^
    dialogs/qprintdialog_unix.cpp: In member function 'void QPrintPropertiesDialog::applyPrinterProperties(QPrinter*)':
    dialogs/qprintdialog_unix.cpp:287:12: error: 'class Ui::QPrintPropertiesWidget' has no member named 'pageSetup'
         widget.pageSetup->setPrinter(p);
                ^
    dialogs/qprintdialog_unix.cpp: In member function 'void QPrintPropertiesDialog::setupPrinter() const':
    dialogs/qprintdialog_unix.cpp:292:12: error: 'const class Ui::QPrintPropertiesWidget' has no member named 'pageSetup'
         widget.pageSetup->setupPrinter();
                ^
    dialogs/qprintdialog_unix.cpp: In member function 'void QPrintPropertiesDialog::selectPrinter()':
    dialogs/qprintdialog_unix.cpp:337:16: error: 'class Ui::QPrintPropertiesWidget' has no member named 'cupsPropertiesPage'
             widget.cupsPropertiesPage->setEnabled(false);
                    ^
    dialogs/qprintdialog_unix.cpp:338:16: error: 'class Ui::QPrintPropertiesWidget' has no member named 'pageSetup'
             widget.pageSetup->selectPrinter(0);
                    ^
    dialogs/qprintdialog_unix.cpp: In member function 'void QPrintPropertiesDialog::selectPdfPsPrinter(const QPrinter*)':
    dialogs/qprintdialog_unix.cpp:345:12: error: 'class Ui::QPrintPropertiesWidget' has no member named 'pageSetup'
         widget.pageSetup->selectPdfPsPrinter(p);
                ^
    dialogs/qprintdialog_unix.cpp:346:12: error: 'class Ui::QPrintPropertiesWidget' has no member named 'tabs'
         widget.tabs->setTabEnabled(1, false); // disable the advanced tab
                ^
    dialogs/qprintdialog_unix.cpp: In member function 'void QPrintDialogPrivate::init()':
    dialogs/qprintdialog_unix.cpp:389:13: error: 'class Ui::QPrintSettingsOutput' has no member named 'color'
         options.color->setIconSize(QSize(32, 32));
                 ^
    dialogs/qprintdialog_unix.cpp:390:13: error: 'class Ui::QPrintSettingsOutput' has no member named 'color'
         options.color->setIcon(QIcon(QLatin1String(":/trolltech/dialogs/qprintdialog/images/status-color.png")));
                 ^
    dialogs/qprintdialog_unix.cpp:391:13: error: 'class Ui::QPrintSettingsOutput' has no member named 'grayscale'
         options.grayscale->setIconSize(QSize(32, 32));
                 ^
    dialogs/qprintdialog_unix.cpp:392:13: error: 'class Ui::QPrintSettingsOutput' has no member named 'grayscale'
         options.grayscale->setIcon(QIcon(QLatin1String(":/trolltech/dialogs/qprintdialog/images/status-gray-scale.png")));
                 ^
    dialogs/qprintdialog_unix.cpp:421:30: error: 'class Ui::QPrintSettingsOutput' has no member named 'reverse'
         QObject::connect(options.reverse, SIGNAL(toggled(bool)),
                                  ^
    dialogs/qprintdialog_unix.cpp: In member function 'void QPrintDialogPrivate::applyPrinterProperties(QPrinter*)':
    dialogs/qprintdialog_unix.cpp:430:17: error: 'class Ui::QPrintSettingsOutput' has no member named 'color'
             options.color->setChecked(true);
                     ^
    dialogs/qprintdialog_unix.cpp:432:17: error: 'class Ui::QPrintSettingsOutput' has no member named 'grayscale'
             options.grayscale->setChecked(true);
                     ^
    dialogs/qprintdialog_unix.cpp:436:17: error: 'class Ui::QPrintSettingsOutput' has no member named 'noDuplex'
             options.noDuplex->setChecked(true); break;
                     ^
    dialogs/qprintdialog_unix.cpp:439:17: error: 'class Ui::QPrintSettingsOutput' has no member named 'duplexLong'
             options.duplexLong->setChecked(true); break;
                     ^
    dialogs/qprintdialog_unix.cpp:441:17: error: 'class Ui::QPrintSettingsOutput' has no member named 'duplexShort'
             options.duplexShort->setChecked(true); break;
                     ^
    dialogs/qprintdialog_unix.cpp:443:13: error: 'class Ui::QPrintSettingsOutput' has no member named 'copies'
         options.copies->setValue(p->copyCount());
                 ^
    dialogs/qprintdialog_unix.cpp:444:13: error: 'class Ui::QPrintSettingsOutput' has no member named 'collate'
         options.collate->setChecked(p->collateCopies());
                 ^
    dialogs/qprintdialog_unix.cpp:445:13: error: 'class Ui::QPrintSettingsOutput' has no member named 'reverse'
         options.reverse->setChecked(p->pageOrder() == QPrinter::LastPageFirst);
                 ^
    dialogs/qprintdialog_unix.cpp: In member function 'void QPrintDialogPrivate::setupPrinter()':
    dialogs/qprintdialog_unix.cpp:490:17: error: 'class Ui::QPrintSettingsOutput' has no member named 'duplex'
         if (options.duplex->isEnabled()) {
                     ^
    dialogs/qprintdialog_unix.cpp:491:21: error: 'class Ui::QPrintSettingsOutput' has no member named 'noDuplex'
             if (options.noDuplex->isChecked())
                         ^
     

    在ubuntu20中遇到了该问题,换了 ubuntu14就可以了

  • 相关阅读:
    LabVIEW通过网络传输数据
    MySQL排查篇:该如何定位并解决线上突发的Bug与疑难杂症?
    Leetcode 2290. 到达角落需要移除障碍物的最小数目
    300PLCmpi转以太网通过兴达易控MPI-ETH-XD1.0在铝型材时效炉中的应用
    Python class:定义类
    【Axure教程】能增删改数据的动态饼图
    java通过IO流下载保存文件
    1014 Waiting in Line(30)& 1017 Queueing at Bank(25)
    saltstack服务端与客户端通信问题处理
    Python中跨越多个文件使用全局变量
  • 原文地址:https://blog.csdn.net/weixin_43777852/article/details/125395832