嵌入式环境搭建之-使用qtcreator 编写嵌入式程序

1. 安装qt 其中就会包含qt

2. 安装交叉编译工具链

配置环境变量 /etc/profile

# 2020年 06月 08日 星期一 17:06:17 CST
# HuaWei LiteOS Linux, Cross-Toolchain PATH
export PATH="/opt/hisi-linux/x86-arm/arm-himix200-linux/bin:$PATH"       

查看环境变量

2.2 配置进入环境变量 使用命令行查看
arm-linux-gnueablihf-gcc -v

3. 在Qt中配置

1.配置编译工具

2.配置qt的Qt mkspec
先拷贝之前的linux-g++ 为linux-自定义-g++
例如:
/usr/lib/i386-linux-gnu/qt5/mkspecs/linux-himix200-g++
查看里面的文件
root@ubutu14:~/keda/workspace/xsocket# ls /usr/lib/i386-linux-gnu/qt5/mkspecs/linux-himix200-g++/
qmake.conf qmake.conf~ qplatformdefs.h

qmake.conf

#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental gdb_dwarf_index
QMAKE_INCREMENTAL_STYLE = sublib

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

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

# modifications to linux.conf
QMAKE_AR                = arm-himix200-linux-ar cqs
QMAKE_OBJCOPY           = arm-himix200-linux-objcopy
QMAKE_NM                = arm-himix200-linux-nm -P
QMAKE_STRIP             = arm-himix200-linux-strip
load(qt_config)

qplatformdefs.h

/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include "../linux-g++/qplatformdefs.h"

//在qt构建方案里面添加

posted @ 2020-07-30 16:08  MCreator  阅读(1258)  评论(0编辑  收藏  举报