本帖最后由 andeyqi 于 2018-6-1 11:09 编辑 K8 Y4 w$ q. _9 j9 ] 2 I. x9 |) C @: U; l闲逛论坛的时候,看到坛友分享的LittlevGL开源gui,初步了解该GUI可以再ST平台上运行,无奈现在手头没有带屛的开发板,即使没有硬件资源,但是无法阻挠继续下去的热情,有样东西叫模拟器,根据github的项目描述,作者已经实现了在模拟器上的运行,先在模拟器上搞下,有开发板时在板子上跑下。以下是github的关于模拟器的描述 |% { p. s! a; Y; a: v" A+ b & ^6 g* N# @- A6 Y6 n 5 i* m" E7 y8 |4 PPC project for LittleV Graphics LibraryThe Littlev Graphic Library is written mainly for microcontrollers and embedded systems however you can run the library on your PC as well without any embedded hardware. The code written on PC can be simply copied when your are using an embedded system.Using a PC simulator instead of an embedded hardware has got several advantages:Costs $0 because you you don't have to buy design PCBFast because you don't have to design an manufacture PCBCollaborative because any number of developers can work without hardware requirementsDeveloper friendly because much easier and faster to debug on PC& G+ n' ]& o+ L! o: A& } , q3 S& r N) q1 _# g1 {- ]& p O+ b 认真观看github的描述,PC模拟器运行环境的搭建是很容易的,笔者按照搭建手顺半小时轻松搞定,成功运行起来,废话不多说了开启正文。 1 y: V% {' {/ G" A: } * F. {$ [1 |/ P& h. D5 w9 B* C========================搭建从此处开启,以上当闲嗑处理=========================== ! O- |- s+ T3 m, }# y+ n7 t 8 q9 J1 f; \6 H$ i9 J本地Linux虚拟机环境UBUNTU16.04_64-bit6 R" j. C- o; u. j UsageGet the PC projectClone the PC project and the related sub modules:git clone http://github.com/littlevgl/proj_pc.gitcd proj_pcgit submodule update --initor download it as zip here.Install SDLYou can download SDL from http://www.libsdl.org/On Linux you can install it via terminal:Find the current version of SDL2: apt-cache search libsdl2 (e.g. libsdl2-2.0-0)Install SDL2: sudo apt-get install libsdl2-2.0-0 (replace with the found version)Install SDL2 development package: sudo apt-get install libsdl2-devIf build essentials are not installed yet: sudo apt-get install build-essential1 m! y6 i) u. [$ S5 t# { Install Eclipse CDTDownload and install Eclipse CDT from http://www.eclipse.org/cdt/Import the PC simulator projectOpen Eclipse CDTClick File->Import and choose General->Existing project into WorkspaceBrowse the root directory of the project and click FinishBuild your project and run it - r: c8 `2 h' t% ?3 Y以上是官方的手册, : ~ D* `9 i8 X) G; a) m# R第一步是获取模拟器环境源码,! I! j" S( u# Q8 N; p1 a9 ? 第二步安装依赖的SDL库, ! N/ ]! L! t2 [! C" ?第三步安装本地运行环境Eclipse, 3 M K+ ?7 j6 H; \: |4 @7 M2 y第四步Eclikpse导入工程。 + ?& D* Y! M5 Y. V5 x , d m) v# d6 q! ]+ c6 j4 P第一步是用git下载源码,安装过程中本着一个原则就可以,提示没有什么就安装什么就行。* U, {) N" F. N5 B. U( P % W/ M6 v `8 w2 N; b# d ubuntu 使用熟悉的 sudo apt-get install XXX 就可以,安装的过程中出了以上设计的安装包外,我有额外安装了git 和 jre。5 [8 X+ H2 q. r ) q5 T2 b$ u5 z: p* _- g% wgit毫无疑问,用git工具下载源码,肯定就要安装了,直接下载源码到本地也可以不安装。, d# G% { c. @3 v5 `7 h0 Z/ H* U jre,运行Eclipse 时需要依赖jre 或者 jdk 提示很明显,直接使用sudo apt-get install jre就可以成功安装,安装过程中可以更换下下安装源,系统自带的安装源下载速度太慢。安装的时候我使用的是以下源,root权限替换到/etc/apt/source.list中即可。 , P2 H; K7 L7 Q* v7 s8 D) Z y( q3 Z8 H* ?. W & z# ? H b9 K* qdeb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties , [% ?: O6 y2 { Zdeb http://mirrors.aliyun.com/ubuntu/ xenial main restricted6 x' e9 ^( k4 S3 U deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties " `5 Z6 q4 ]! C: |: Tdeb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted s# X: I: L4 R9 |- T: ?: Rdeb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties ) c3 L+ U$ d1 v6 N9 F) Ydeb http://mirrors.aliyun.com/ubuntu/ xenial universe7 ~" r5 r0 H" {" M: D' m- j deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe+ m8 Z9 i0 j$ R3 S! e" ~# e deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse( m( ?9 K& N: |+ v" B7 t- F y deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse & e, u( g9 n. a! p4 [$ ]deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse+ y: |: E- v6 W3 H deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties* L/ b. y0 Y4 s& F- |" w9 `2 W deb http://archive.canonical.com/ubuntu xenial partner5 `1 S' c; p7 ~: P' C" y deb-src http://archive.canonical.com/ubuntu xenial partner ) {. y6 {8 j0 @( d# Ydeb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted ! b+ `6 \2 I: |/ v3 n, i% b6 ?deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties S) ?5 ? ?2 w1 s+ R deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe# Z8 x) p4 i; J4 |# Z3 k" ` deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse % K# h R$ [! n: J' o/ a& o" d3 [! ]8 g7 ?7 Y( } #3.1.2:东北大学:" k" h+ ~1 `% k6 p5 B) ~# X( Z* R7 L deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties; `( C* l! ^5 ?, @$ V; g. M # j; }3 D; H4 g# i# d9 e/ b3 J deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted0 c# K( o) t+ M5 b) j& L % F( M/ w8 G5 a: D- Y+ K2 N* { deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties) I5 Z9 Q) E0 [& W $ B) i6 x. Y5 K deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted) C2 _2 J( Y" _* H+ J0 F. z( j # p% N1 J* N- p4 n deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties 6 K6 \ n) C- E: a' \+ O0 J+ S1 h- X/ A. A" v deb http://mirror.neu.edu.cn/ubuntu/ xenial universe ; w4 b. h+ _% d8 O + `* ?# c/ R" Y) Y4 Udeb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe& I+ t }- y; F4 i- d8 j" a1 n - E( f9 e. v( z0 `; q# fdeb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse 2 C+ _ O) d/ a( U+ l" G 0 w' I& r! Q% O3 O; W( Ideb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse 2 K" x' C( [ e4 P' C. v' o5 c; ?* T& } deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse $ f1 p+ g( H' \- n$ h: A% u $ J5 t- Y! Z- m( k* w( vdeb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties # M/ A& w$ w6 ?2 u9 r# E3 }6 j u& b6 H1 P1 U! t- W" n3 {deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner; V3 \. a- [9 ?' ]0 c+ t: ] : Z& l# J8 j* Q1 O( qdeb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted 7 p3 u- g0 H) r. z3 Z1 y% }& i6 [; V0 P deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties# o# C# {$ C, w: N: H) Z 1 p S3 n+ G/ L3 L; `6 Z# W deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe4 Y; V+ g- j7 S1 s8 ]/ ] ! q. j. ~$ j+ s! b& ?9 Edeb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse 8 E+ Q; l, s: d. X/ d+ F) H+ I X) f ]: r5 o; t1 G" r#3.1.3:清华大学: & |* n- X4 s7 {1 V0 Xdeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted0 Q! }# ~5 U2 k4 v: G! V3 l 2 ` ^0 e w3 c& _- Sdeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted7 f i( ~/ C9 {' | ( e7 I9 g- i) [/ Mdeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe 1 W. x" s* t. B1 Y$ r# n3 N% p. W( F, U6 u3 |6 P! M8 Z deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe % @9 r1 O( @" F% G 1 D1 O. ^; w4 o* m: T8 S2 [deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse 1 T' N2 ]4 [4 r: ?5 w0 C ! m$ l o6 h$ ^; j% jdeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse : U6 z7 @# y1 u( ^, r* P 2 U0 ~! R+ @" }7 bdeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse# U2 v) d- m/ U8 q2 y, B # W0 i, n T: t! j8 ~1 t6 E- s' Ddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted2 F2 I$ V* u K( A/ e * M, Y- a) F$ S* r3 y$ a" hdeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse s7 }$ g/ u3 h$ v | ' d, j0 e* D% X8 |复制代码 & O! f4 `) G8 cdebug运行时,提示找不到可执行程序,设置后就可以正常运行。 8 K8 }( p5 T9 y8 g3 N! m 7 P7 \2 R- J8 f (, 下载次数: 22) 上传 点击文件名下载附件 ; L+ f1 z3 s' X% @/ M " `) h5 X3 O$ M, m5 Z; _; J! v/ S模拟器的配置可以参照如下视频。 & T X- B0 E6 @7 k6 C% W; ?2 f% L4 y5 r% M3 i$ s% B http://www.youtube.com/watch?v=ZzLdct2ymvg&feature=youtu.be ! }& @ o6 |# e4 F$ b, v& p L. X1 D x+ s/ v 最后看下运行效果,有图有真相,没搞过gif,会的小伙伴可以留言教我下,简单上几个图片吧。 9 D4 E- K8 m1 j7 r/ E/ B6 e) x; l$ x! X! q8 t1 b6 l7 @ (, 下载次数: 18) 上传 点击文件名下载附件 , T' |0 l4 Y2 J; O1 ^- I( x (, 下载次数: 15) 上传 点击文件名下载附件 5 J0 j4 H, b- D5 P2 Z; R 8 t( ~) w ]4 y (, 下载次数: 19) 上传 点击文件名下载附件 ! n, ~2 u. U+ a6 ?/ g0 K' R/ G" S8 x; W' r, ?0 m