在尝试使用TouchGFX的时候会遇到很多坑。尤其是你使用TouchGX Designer并采用官方模板生成的工程。你需要添加很多头文件和源文件到工程中。- <touchgfx_application_root_directory>/gui/include- ]5 e. y: q& s% Q
- <touchgfx_application_root_directory>/generated/gui_generated/include
; a7 ^1 |: f4 T; k" K3 M* Z - <touchgfx_application_root_directory>/platform/os4 _" v+ r/ ~6 F0 Q
- <touchgfx_application_root_directory>/generated/fonts/include% K: J1 W/ R9 M8 V5 B$ R( Y
- <touchgfx_application_root_directory>/generated/images/include
7 [+ S; N2 v3 B& |. Z: H8 A# \ - <touchgfx_application_root_directory>/generated/texts/include/ B) }8 `. z$ i: i5 _+ k$ z
- <touchgfx_application_root_directory>/touchgfx/framework/include
复制代码 但是即便你尝试这样做之后,还会提示下面的错误:( h7 t) |. e8 V/ ]; ^6 w% X' ]! ~
Error: L6218E: Undefined symbol __aeabi_assert (referred from TouchGFXHAL.o)
! D* m z' B4 q; A6 |1 `7 T9 M在开头还会提示你MicroLib和C++同时使用的警告。
: e; n8 ~% d2 K8 i' x2 \在参考这篇文档(http://www.keil.com/support/docs/4073.htm)之后你可以看到解决方案。' y1 E0 {$ q; ]: Z9 t( [1 r
就是把MicroLib给勾掉。
- x N* ~, x# P9 [' N3 N# P, R% B9 E2 ^# K9 ^ x6 m: a: q9 H: Q
引申:! p, ]0 Y3 ~8 r7 ~# y, l; Q- [- q' x
那为什么会这样?# h# l* T/ H9 o" |7 [; N
可以参考这篇文档的介绍:http://www.keil.com/support/man/docs/ARMLIB/armlib_chr1358938938431.htm% {4 V& X" O+ f/ ]; ?8 S
基本上告知了MicroLib以下几个特点:
! i, Y) k4 a5 b' O- k- 1、Microlib is not compliant with the ISO C library standard 不兼容标准ISO C库' v5 V+ @; w/ D5 f6 l& H- L
- 2、Microlib is not compliant with the IEEE 754 standard for binary floating-point arithmetic 不兼容IEEE 754标准浮点运算6 n z/ |+ n' {1 P4 \& v# M
- 3、Microlib is highly optimized for small code size高优化,小尺寸% J1 c4 Q0 k: G: R
- 4、Locales are not configurable 只有一个Locale,不可配置9 I6 t0 B) f2 K6 F6 [0 k
- 5、main() must not be declared to take arguments and must not return. Main函数不带参,不返回* o/ N/ A% t$ W& W) v8 L
- 6、Microlib provides limited support for C99 functions。对C99支持不完善
( ]- j3 X- a5 ?' H - 7、Microlib does not support C++ 不支持C++9 D) U T; i* a6 `
- 8、Microlib does not support operating system functions不支持操作系统函数
. G5 j6 b, E- `" S6 r - 9、Microlib does not support position-independent code 不支持地址无关代码(http://zh.wikipedia.org/wiki/%E5%9C%B0%E5%9D%80%E6%97%A0%E5%85%B3%E4%BB%A3%E7%A0%81)
- f+ r6 ~# w4 f# K3 F7 L; J - 10、Microlib does not provide mutex locks to guard against code that is not thread safe不能通过mutex lock确保代码安全& n9 m- P' |0 R- G1 {/ v% A% m2 @" I
- 11、Microlib does not support wide characters or multibyte strings不支持宽字符和多字节字符串- n" q2 E& |' G! M ?. S6 A
- ...太多了,不翻译了
复制代码 7 {; f( l7 u6 C0 s W
其中第7条就告知了不支持c++。
( f. F& z4 [! h* S4 \5 E' ^- V5 n. _: W. {9 _
- N* _) r: W; j6 Y, k, g9 f& v' j) G' W. a7 s3 F
3 @$ I# p0 Q1 V4 q' E
|