永利平台娱乐ARM嵌入式版本,/usr/include拷贝到了

2019-12-01 07:28 来源:未知

安装qt时在执行./configure时报错:error: unrecognized command line option ‘-fuse-ld=gold’

本文记录PC(x86)下安装Linux/X11版Qt 开发环境。下载页面:

QT交叉编译 缺少sys/cdefs.h
交叉编译QT,因为要用的xcb等库,所以直接把开发板内的/lib /usr/lib /usr/include拷贝到了虚拟机,
解压qt源码,配置qmake.conf
#

这个错误是qt的一个bug。

ARM嵌入式版本qt库的编译安装详见《unbunt12.04编译安装qt-embedded-4.8.1》

qmake configuration for building with aarch64-linux-gnu-g++

#

MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

QMAKE_CXXFLAGS += -I/home/ubuntu/yk/usr/include
QMAKE_CXXFLAGS += -I/home/ubuntu/yk/usr/include/aarch64-linux-gnu
QMAKE_CFLAGS += -I/home/ubuntu/yk/usr/include
QMAKE_CFLAGS += -I/home/ubuntu/yk/usr/include/aarch64-linux-gnu

QMAKE_LFLAGS += /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/lib/
QMAKE_LFLAGS += -L/home/ubuntu/yk/lib/aarch64-linux-gnu
QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/lib/aarch64-linux-gnu
QMAKE_LFLAGS += -L/home/ubuntu/yk/usr/lib/aarch64-linux-gnu
QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/usr/lib/aarch64-linux-gnu
QMAKE_LFLAGS += -L/home/ubuntu/yk/lib
QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/lib
QMAKE_LFLAGS += -L/home/ubuntu/yk/usr/lib
QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/usr/lib

QMAKE_LIBS += -lpthread -lgobject-2.0 -lglib-2.0 -lpcre
QMAKE_CFLAGS += -O2 -march=armv7-a -mfpu=neon -mfloat-abi=hard
QMAKE_CXXFLAGS += -O2 -march=armv7-a -mfpu=neon -mfloat-abi=hard

QMAKE_LFLAGS += -L/home/ubuntu/yk/lib
QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/lib
QMAKE_LFLAGS += -L/home/ubuntu/yk/usr/lib
QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/usr/lib

在装有gold linker的系统里,编译脚本会加入-fuse-ld=gold选项,但这个选项gcc是不支持的。
解决办法是移除该选项,找到文件src/3rdparty/webkit/Source/common.pri,屏蔽QMAKE_LFLAGS+=-fuse-ld=gold。
将# QMAKE_LFLAGS+=-fuse-ld=gold注释掉即可。


modifications to g++.conf

QMAKE_CC = aarch64-linux-gnu-gcc
QMAKE_CXX = aarch64-linux-gnu-g++
QMAKE_LINK = aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB = aarch64-linux-gnu-g++

参考文章:

我们选择qt-everywhere-opensource-src-4.8.5.tar.gz版本。选择Qt libraries 4.8.5 for Linux/X11 (230 MB) (Info) 得到qt-everywhere-opensource-src-4.8.5.tar.gz,这个和 Qt libraries 4.8.5 for embedded Linux (230 MB) (Info) 是同一个文件,配置不同就可以编译出不同的版本,这就是“everywhere”版本的本意~,其默认编译安装的是X11(即PC)版本!

modifications to linux.conf

QMAKE_AR = aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY = aarch64-linux-gnu-objcopy
QMAKE_NM = aarch64-linux-gnu-nm -P
QMAKE_STRIP = aarch64-linux-gnu-strip
load(qt_config)

执行configure后提示错误

ubuntu@ubuntuPC:~/yk/qt-everywhere-opensource-src-5.8.0$ ./configure -release -nomake examples -no-iconv -qt-xcb -qpa xcb -no-opengl -sysroot /home/ubuntu/yk/ -xplatform linux-arm-gnueabi-g++ -prefix /home/ubuntu/Qt5.8.0_arm -opensource -confirm-license

  • cd qtbase
  • /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/configure -top-level -release -nomake examples -no-iconv -qt-xcb -qpa xcb -no-opengl -sysroot /home/ubuntu/yk/ -xplatform linux-arm-gnueabi-g++ -prefix /home/ubuntu/Qt5.8.0_arm -opensource -confirm-license

This is the Qt Open Source Edition.

You are licensed to use this software under the terms of
the GNU Lesser General Public License version 3.
You are also licensed to use this software under the terms of
the GNU General Public License version 2.

You have already accepted the terms of the Open Source license.

Creating qmake...
........................................................................................Done.
Info: creating stash file /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/.qmake.stash
Info: creating super cache file /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/.qmake.super

Running configuration tests...
Checking for gold linker... yes
Checking for valid makespec... yes
Checking for target architecture... Project ERROR: Could not determine target architecture. See config.log for details.

查看config.log

executing config test architecture

  • cd /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/arch && /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/bin/qmake -qtconf /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker console" "QMAKE_CFLAGS += --sysroot=/home/ubuntu/yk/" "QMAKE_CXXFLAGS += --sysroot=/home/ubuntu/yk/" "QMAKE_LFLAGS += --sysroot=/home/ubuntu/yk/" /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/arch
  • cd /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/arch && MAKEFLAGS= /usr/bin/make> g++ -c -pipe --sysroot=/home/ubuntu/yk/ -g -Wall -W -fPIC -I. -I/home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/linux-g++ -o arch.o arch.cpp> In file included from /home/ubuntu/yk/usr/include/stdio.h:27:0,> from arch.cpp:43:> /home/ubuntu/yk/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory> compilation terminated.> Makefile:167: recipe for target 'arch.o' failed> make: *** [永利平台娱乐,arch.o] Error 1

找不到sys/cdefs.h
但是我配置的目录下面 /home/ubuntu/yk/usr/include/aarch64-linux-gnu 有sys/cdefs.h
找了一天问题了,还缺少配置什么路径?


安装Linux/X11版Qt:

 

#tar -xvzf qt-everywhere-opensource-src-4.8.5.tar.gz

#cd qt-everywhere-opensource-src-4.8.5

#./configure -prefix /opt/qt-4.8.5-x11

#make

#make install

TAG标签:
版权声明:本文由永利平台娱乐发布于每日更新,转载请注明出处:永利平台娱乐ARM嵌入式版本,/usr/include拷贝到了