2377 views|6 replies

501

Posts

4

Resources
The OP
 

Mir MYC-YT507 development board review: Development environment part 3: Qt tank game [Copy link]

 

Preface

This article uses a popular tank game implemented in Qt to experience the Qt development process of this development board, focusing mainly on the convenience of setting up the development environment from the perspective of secondary development.

Prepare

Refer to "Mil MYC-YT507 Development Board Evaluation: Development Environment Part 1: Linux C Key Control LED" to install the cross-compilation environment.

And basic login file transfer and other operations.

Install Qt development environment

Install the compilation environment

Download the data from http://down.myir-tech.com/MYD-YT507H/ in Windows, and unzip 03_Tools.zip

I unzipped it to E:\BOARD\MYC-YT507\03_Tools

Change the name of the folder Complie Toolchain to Complie_Toolchain because command line file names in Linux cannot have spaces.

wsl

cd ~

mkdir MYD-YT507H

cd MYD-YT507H/

Unzip the files under Windows directly into WSL

tar -xvf /mnt/e/BOARD/MYC-YT507/03_Tools/Complie_Toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu-qt5.12.5-myir.tar.bz2 -C .

Install Qt Creator

Download QtCreator

wget https://mirrors.tuna.tsinghua.edu.cn/qt/development_releases/qtcreator/5.0/5.0.0-rc1/qt-creator-opensource-linux-x86_64-5.0.0-rc1.run

chmod +x qt-creator-opensource-linux-x86_64-5.0.0-rc1.run

./qt-creator-opensource-linux-x86_64-5.0.0-rc1.run

Need to register an account

Run /home/lhj/qtcreator-5.0.0-rc1/bin/qtcreator.sh &

Configuration

Click Tools -> Options in the menu bar

Configuring the Compiler

Click Kits on the left and select the Compilers tab on the right.

Add G++ compiler

Set Name to YT507H-G++

Compiler path is /home/lhj/MYD-YT507H/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++

Click "Apply"

Add the GCC compiler in the same way

Set Name to YT507H-GCC

Compiler path is

/home/lhj/MYD-YT507H/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc

After configuration, it is as follows

Configure Qmake

Select the "Qt Version" tab and click "Add..." on the right. The qmake path selection dialog box will pop up.

Select /home/lhj/MYD-YT507H/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/Qt_5.12.5/bin/qmake, click Open

Change "Version name" to Qt %{Qt:Version} (MYIR-YT507H-System). Then click the "Apply" button

Configuring Device

Select "Device" on the left and click the "Add..." button on the right.

Configuring Kits

Kits on the left, Kits tab on the right, click Add

Set Name to YT507H-dev-kit

Select Device Type

Select Device

Select Sysroot:/home/lhj/MYD-YT507H/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/Qt_5.12.5/aarch64-buildroot-linux-gnu/sysroot

Compiler selects the C and C++ compilers just configured

Qt version select Qt 5.12.5 (MYIR-YT507H- System)

"Qt mkspec" is filled in with "linux-aarch64-gnu-g++"

Click Apply

Click OK

Tanks

git clone

链接已隐藏,如需查看请登录或者注册

Open QtCreator

/home/lhj/qtcreator-5.0.0-rc1/bin/qtcreator.sh &

File-> Open File or Project... Select the code you just cloned

Select YT507H-dev-kit

Click Configure Project

Menu Bar

Build->Clean

Build->Build All Projects

hint

Search find ../ -name libGLESv2.so

Find the path as

/home/lhj/MYD-YT507H/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/Qt_5.12.5/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv2.so

Manually modify /home/lhj/MYD-YT507H/build-tanks-YT507H_dev_kit-Debug/Makefile. The content in the red box above is /home/lhj/MYD-YT507H/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/Qt_5.12.5/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv2.so

The compiled code is located in

/home/lhj/MYD-YT507H/build-tanks-YT507H_dev_kit-Debug/Tanks

Export to Windows

cp /home/lhj/MYD-YT507H/build-tanks-YT507H_dev_kit-Debug/Tanks /mnt/e

Then import it to the development board.

run

ps check the process number of myapp2 and kill it

export QT_DEBUG_PLUGINS=1 enables debugging printing to facilitate problem analysis

./Tanks Run

If you print

./Tanks: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory

but:

export LD_LIBRARY_PATH=/usr/local/Qt_5.12.5/lib/:$LD_LIBRARY_PATH

Check here that the library path is /usr/local/Qt_5.12.5/ and the one referenced in the program is /usr/local/Qt-5.12.5/

So create a soft link

ln -s /usr/local/Qt_5.12.5/plugins/platforms/ /root/platforms

ln -s /usr/local/Qt_5.12.5 /usr/local/Qt-5.12.5

If you print

loaded library "/usr/local/Qt_5.12.5/plugins/egldeviceintegrations/libqeglfs-emu-integration.so"

EGL library doesn't support Emulator extensions

Aborted

but

export QT_QPA_EGLFS_INTEGRATION=none

If you print

QFontDatabase: Cannot find font directory /usr/local/Qt-5.12.5/lib/fonts.

Then soft link to the actual font file

ln -s /usr/local/Qt-5.12.5/fonts/ /usr/local/Qt-5.12.5/lib/fonts

Use USB mouse and keyboard to control

button

W: Forward

S: Back

A: Turn left

D: Turn right

Press buttons 1, 2, and 3 to select the firepower.

Press the q button to shoot.

Press s to pause and continue

Summarize

The development board supports Qt5.12, and the corresponding operating environment has been installed in the image. The SDK also provides a tool chain that can be used directly, so development is very convenient, and the relevant documents are also relatively detailed and developer-friendly.

refer to

MYD-YT507H_QT Application Development Notes.pdf

This post is from Domestic Chip Exchange

Latest reply

Come on!!!! They are all at god level.   Details Published on 2022-8-17 08:35
 
 

6593

Posts

0

Resources
2
 

The development board supports many functions, and the host introduced it in detail.

This post is from Domestic Chip Exchange
 
 
 

6841

Posts

11

Resources
3
 
I want to install pyqt, but I can't get it done after trying for a long time!
This post is from Domestic Chip Exchange

Comments

nmg
Missing a package? You can search for errors on Baidu and usually find a solution.  Details Published on 2022-7-28 17:01
 
 
 

7462

Posts

2

Resources
4
 

Awesome, I've always wanted to learn how to make games...

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

5221

Posts

239

Resources
5
 
lugl4313820 posted on 2022-7-24 10:55 I want to install pyqt, but I can't get it done after a long time!

Missing a package? You can search for errors on Baidu and usually find a solution.

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle

Comments

I changed it to tkinter   Details Published on 2022-7-28 17:06
 
 
 

6841

Posts

11

Resources
6
 
nmg posted on 2022-7-28 17:01 Missing a package? You can search for the error on Baidu, and you can usually find a solution

I changed it to tkinter

This post is from Domestic Chip Exchange
 
 
 

173

Posts

0

Resources
7
 

Come on!!!! They are all at god level.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list