WhyCan Forum

本站无需注册,无需积分,无需回复可下载所有资料,如果真的喜欢小站,请您注册之后请至少回复一个帖子激活Id,谢谢支持! 站长QQ: 516333132 (挖坑网/填坑网) admin@whycan.cn

您尚未登录。

#1 2019-02-11 13:58:17

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 6,164

离线

#2 2019-02-11 14:48:25

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 6,164

Re: LittleVGL 可以运行在 浏览器上了

1. 安装 Emscripten SDK

  1. cd /opt

  2. git clone https://github.com/emscripten-core/emsdk.git

  3. cd emsdk

  4. git pull

  5. ./emsdk install latest

  6. ./emsdk activate latest

  7. source ./emsdk_env.sh



下载emscripten项目源码编译:

  1. cd /opt

  2. git clone https://github.com/littlevgl/emscripten.git

  3. cd emscripten

  4. git submodule update --init --recursive

  5. make

以下三个文件是编译生成:

  1. lvgl.html

  2. lvgl.js

  3. lvgl.wasm


浏览器打开 lvgl.html
20190211145326.png

ubuntu 14.04 编译失败:

root@debugdump:/opt/emscripten# make
 CC  lvgl/lv_draw/lv_draw_line.c
emscripten:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/root/.emscripten_cache/is_vanilla.txt" for subsequent builds)
/opt/emsdk/clang/e1.38.26_64bit/llc: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /opt/emsdk/clang/e1.38.26_64bit/llc)
/opt/emsdk/clang/e1.38.26_64bit/llc: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /opt/emsdk/clang/e1.38.26_64bit/llc)
emscripten:INFO:  - ok
/opt/emsdk/clang/e1.38.26_64bit/clang++: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /opt/emsdk/clang/e1.38.26_64bit/clang++)
/opt/emsdk/clang/e1.38.26_64bit/clang++: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /opt/emsdk/clang/e1.38.26_64bit/clang++)
shared:ERROR: '/opt/emsdk/clang/e1.38.26_64bit/clang++ --version' failed (1)
make: *** [lvgl/lv_draw/lv_draw_line.o] Error 1
root@debugdump:/opt/emscripten# ls /usr/lib/x86_64-linux-gnu/libstdc++.so.6*
/usr/lib/x86_64-linux-gnu/libstdc++.so.6  /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19
root@debugdump:/opt/emscripten# ls /usr/lib/x86_64-linux-gnu/libstdc++.so.6* -l
lrwxrwxrwx 1 root root     19 Feb 14  2018 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 -> libstdc++.so.6.0.19
-rw-r--r-- 1 root root 979056 Feb 14  2018 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19
root@debugdump:/opt/emscripten#

ubuntu 16.04 编译没有问题:

root@ubuntu:/opt/emscripten# make
 CC  lvgl/lv_draw/lv_draw_line.c
emscripten:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/root/.emscripten_cache/is_vanilla.txt" for subsequent builds)
emscripten:INFO:  - ok
shared:INFO: (Emscripten: Running sanity checks)
root:WARNING: retrieving port: sdl2 from https://github.com/emscripten-ports/SDL2/archive/version_17.zip
root:WARNING: unpacking port: sdl2
emscripten:INFO: generating port: sdl2.bc... (this will be cached in "/root/.emscripten_cache/asmjs/sdl2.bc" for subsequent builds)
emscripten:INFO:  - ok
 CC  lvgl/lv_draw/lv_draw_rbasic.c
 CC  lvgl/lv_draw/lv_draw_img.c
 CC  lvgl/lv_draw/lv_draw_arc.c
 CC  lvgl/lv_draw/lv_draw_rect.c
 CC  lvgl/lv_draw/lv_draw_triangle.c
 CC  lvgl/lv_draw/lv_draw.c
 CC  lvgl/lv_draw/lv_draw_label.c
 CC  lvgl/lv_draw/lv_draw_vbasic.c
 CC  lvgl/lv_fonts/lv_font_builtin.c
 CC  lvgl/lv_fonts/lv_font_dejavu_20.c
 CC  lvgl/lv_fonts/lv_font_dejavu_40.c
 CC  lvgl/lv_fonts/lv_font_dejavu_30_latin_sup.c
 CC  lvgl/lv_fonts/lv_font_dejavu_10_cyrillic.c
 CC  lvgl/lv_fonts/lv_font_monospace_8.c
 CC  lvgl/lv_fonts/lv_font_dejavu_10_latin_sup.c
 CC  lvgl/lv_fonts/lv_font_symbol_40.c
 CC  lvgl/lv_fonts/lv_font_symbol_10.c
 CC  lvgl/lv_fonts/lv_font_dejavu_10.c
 CC  lvgl/lv_fonts/lv_font_dejavu_40_cyrillic.c
 CC  lvgl/lv_fonts/lv_font_dejavu_20_cyrillic.c
 CC  lvgl/lv_fonts/lv_font_dejavu_30_cyrillic.c
 CC  lvgl/lv_fonts/lv_font_dejavu_20_latin_sup.c
 CC  lvgl/lv_fonts/lv_font_dejavu_40_latin_sup.c
 CC  lvgl/lv_fonts/lv_font_symbol_30.c
 CC  lvgl/lv_fonts/lv_font_symbol_20.c
 CC  lvgl/lv_fonts/lv_font_dejavu_30.c
 CC  lvgl/lv_objx/lv_cont.c
 CC  lvgl/lv_objx/lv_img.c
 CC  lvgl/lv_objx/lv_kb.c
 CC  lvgl/lv_objx/lv_table.c
 CC  lvgl/lv_objx/lv_roller.c
 CC  lvgl/lv_objx/lv_cb.c
 CC  lvgl/lv_objx/lv_led.c
 CC  lvgl/lv_objx/lv_calendar.c
 CC  lvgl/lv_objx/lv_gauge.c
 CC  lvgl/lv_objx/lv_page.c
 CC  lvgl/lv_objx/lv_list.c
 CC  lvgl/lv_objx/lv_bar.c
 CC  lvgl/lv_objx/lv_tabview.c
 CC  lvgl/lv_objx/lv_mbox.c
 CC  lvgl/lv_objx/lv_objx_templ.c
 CC  lvgl/lv_objx/lv_sw.c
 CC  lvgl/lv_objx/lv_label.c
 CC  lvgl/lv_objx/lv_slider.c
 CC  lvgl/lv_objx/lv_ddlist.c
 CC  lvgl/lv_objx/lv_imgbtn.c
 CC  lvgl/lv_objx/lv_line.c
 CC  lvgl/lv_objx/lv_chart.c
 CC  lvgl/lv_objx/lv_btnm.c
 CC  lvgl/lv_objx/lv_arc.c
 CC  lvgl/lv_objx/lv_preload.c
 CC  lvgl/lv_objx/lv_win.c
 CC  lvgl/lv_objx/lv_lmeter.c
 CC  lvgl/lv_objx/lv_btn.c
 CC  lvgl/lv_objx/lv_ta.c
 CC  lvgl/lv_misc/lv_log.c
 CC  lvgl/lv_misc/lv_fs.c
 CC  lvgl/lv_misc/lv_task.c
 CC  lvgl/lv_misc/lv_circ.c
 CC  lvgl/lv_misc/lv_anim.c
 CC  lvgl/lv_misc/lv_color.c
 CC  lvgl/lv_misc/lv_txt.c
 CC  lvgl/lv_misc/lv_math.c
 CC  lvgl/lv_misc/lv_mem.c
 CC  lvgl/lv_misc/lv_font.c
 CC  lvgl/lv_misc/lv_ll.c
 CC  lvgl/lv_misc/lv_area.c
 CC  lvgl/lv_misc/lv_templ.c
 CC  lvgl/lv_misc/lv_ufs.c
 CC  lvgl/lv_misc/lv_gc.c
 CC  lvgl/lv_hal/lv_hal_tick.c
 CC  lvgl/lv_hal/lv_hal_indev.c
 CC  lvgl/lv_hal/lv_hal_disp.c
 CC  lvgl/lv_themes/lv_theme_mono.c
 CC  lvgl/lv_themes/lv_theme_templ.c
 CC  lvgl/lv_themes/lv_theme_material.c
 CC  lvgl/lv_themes/lv_theme.c
 CC  lvgl/lv_themes/lv_theme_night.c
 CC  lvgl/lv_themes/lv_theme_zen.c
 CC  lvgl/lv_themes/lv_theme_nemo.c
 CC  lvgl/lv_themes/lv_theme_alien.c
 CC  lvgl/lv_themes/lv_theme_default.c
 CC  lvgl/lv_core/lv_group.c
 CC  lvgl/lv_core/lv_style.c
 CC  lvgl/lv_core/lv_indev.c
 CC  lvgl/lv_core/lv_vdb.c
 CC  lvgl/lv_core/lv_obj.c
 CC  lvgl/lv_core/lv_refr.c
 CC  lv_examples/lv_tests/lv_test_theme/lv_test_theme_1.c
 CC  lv_examples/lv_tests/lv_test_theme/lv_test_theme_2.c
 CC  lv_examples/lv_tests/lv_test_stress/lv_test_stress.c
 CC  lv_examples/lv_tests/lv_test_objx/lv_test_img/img_flower_icon.c
 CC  lv_examples/lv_tests/lv_test_objx/lv_test_arc/lv_test_arc.c
 CC  lv_examples/lv_tests/lv_test_group/lv_test_group.c
 CC  lv_examples/lv_apps/demo/demo.c
 CC  lv_examples/lv_apps/demo/img_bubble_pattern.c
 CC  lv_drivers/display/monitor.c
 CC  lv_drivers/indev/mouse.c
 CC  lv_drivers/indev/keyboard.c
 CC  lv_drivers/indev/mousewheel.c
 CC  main.c
 CC  mouse_cursor_icon.c
 LINK  lvgl.html
emscripten:INFO: generating system library: libdlmalloc.bc... (this will be cached in "/root/.emscripten_cache/asmjs/libdlmalloc.bc" for subsequent builds)
emscripten:INFO:  - ok
emscripten:INFO: generating system library: libgl.bc... (this will be cached in "/root/.emscripten_cache/asmjs/libgl.bc" for subsequent builds)
emscripten:INFO:  - ok
emscripten:INFO: generating system library: libc.bc... (this will be cached in "/root/.emscripten_cache/asmjs/libc.bc" for subsequent builds)
emscripten:INFO:  - ok
emscripten:INFO: generating system library: libcompiler_rt.a... (this will be cached in "/root/.emscripten_cache/asmjs/libcompiler_rt.a" for subsequent builds)
emscripten:INFO:  - ok
emscripten:INFO: generating system library: libc-wasm.bc... (this will be cached in "/root/.emscripten_cache/asmjs/libc-wasm.bc" for subsequent builds)
emscripten:INFO:  - ok
emscripten:INFO: generating system library: libc-extras.bc... (this will be cached in "/root/.emscripten_cache/asmjs/libc-extras.bc" for subsequent builds)
emscripten:INFO:  - ok
emscripten:INFO: generating system asset: generated_struct_info.json... (this will be cached in "/root/.emscripten_cache/asmjs/generated_struct_info.json" for subsequent builds)
emscripten:INFO:  - ok
root@ubuntu:/opt/emscripten#

离线

#3 2019-02-11 19:22:27

Dillon
会员
注册时间: 2017-12-15
累计积分: 4

Re: LittleVGL 可以运行在 浏览器上了

真棒?,三星手机自带浏览器可以直接运行例子

离线

#4 2019-02-19 14:50:53

不安分的少年
会员
注册时间: 2019-02-19
累计积分: 1

Re: LittleVGL 可以运行在 浏览器上了

可以说是很six了

离线

页脚