---
# System prepended metadata

title: zynq petalinux Qt 環境建立(2018.3)
tags: [zynq]

---

# zynq petalinux Qt 環境建立(2018.3)

**操作環境:**
ubuntu(16.04)
hdl(2018_r1):git checkout 到2018_r1
meta-adi(2018_r1):git checkout 到2019_r1
filesystem:x11+x11-dev,qt+qt-dev,qt-extend+qt-extend-dev


# qt source code 5.9.6編譯參數
```bash=
./configure -release -xplatform linux-arm-gnueabi-g++ -no-opengl -no-openssl -nomake tests -no-compile-examples -nomake examples -gif -ico -qt-libpng -qt-libjpeg -qt-sqlite -prefix $ZYNQ_QT_INSTALL
```
## qtcreator 設定
cmake 是用 ubuntu的/usr/bin/make
qmake 是用qt5.9.6編譯出來的bin/qmake

arm-linux-gnueabihf-gcc,arm-linux-gnueabihf-g++,arm-linux-gnueabihf-gdb是用"SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin"裡面的

## 開機執行腳本
在/etc/profile.d/bash_completion.sh檔案最底下加入以下指令內容以便在開機後自動執行
```bash=
echo 1 > /sys/class/leds/ld0\:red/brightness                                    
sleep 2                                                                         
echo 0 > /sys/class/leds/ld0\:red/brightness                                    
export DISPLAY=:0.0                                                           
Xorg &
```

參考資料:
[zcu102_A_PetaLinux运行Qt程序](https://blog.csdn.net/botao_li/article/details/86712517)
###### tags: `zynq`