Problem with the LIDAR TF-LC02 and ESP32

I try to run the TF-LC02 with an ESP32-WROOM32 but get the follow error.
exit status 1
Compilation error: ‘T8’ does not name a type

Any Idea whats wrong?

n file included from c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/MUIU8g2.h:44,
                 from D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:1:
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:127:1: error: 'u8g2_uint_t' does not name a type; did you mean 'u8g2_u8toa'?
 u8g2_uint_t mui_get_x(mui_t *ui);
 ^~~~~~~~~~~
 u8g2_u8toa
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:128:1: error: 'u8g2_uint_t' does not name a type; did you mean 'u8g2_u8toa'?
 u8g2_uint_t mui_get_y(mui_t *ui);
 ^~~~~~~~~~~
 u8g2_u8toa
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:129:1: error: 'u8g2_t' does not name a type; did you mean 'sig_t'?
 u8g2_t *mui_get_U8g2(mui_t *ui);
 ^~~~~~
 sig_t
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:131:42: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_utf(mui_t *ui, u8g2_uint_t flags, u8g2_uint_t width, u8g2_uint_t padding_h, u8g2_uint_t padding_v, const char *text);
                                          ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:131:61: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_utf(mui_t *ui, u8g2_uint_t flags, u8g2_uint_t width, u8g2_uint_t padding_h, u8g2_uint_t padding_v, const char *text);
                                                             ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:131:80: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_utf(mui_t *ui, u8g2_uint_t flags, u8g2_uint_t width, u8g2_uint_t padding_h, u8g2_uint_t padding_v, const char *text);
                                                                                ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:131:103: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_utf(mui_t *ui, u8g2_uint_t flags, u8g2_uint_t width, u8g2_uint_t padding_h, u8g2_uint_t padding_v, const char *text);
                                                                                                       ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:132:1: error: 'u8g2_uint_t' does not name a type; did you mean 'u8g2_u8toa'?
 u8g2_uint_t mui_u8g2_get_pi_flags(mui_t *ui);
 ^~~~~~~~~~~
 u8g2_u8toa
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:133:41: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_pi(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                         ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:133:60: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_pi(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                                            ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:134:1: error: 'u8g2_uint_t' does not name a type; did you mean 'u8g2_u8toa'?
 u8g2_uint_t mui_u8g2_get_fi_flags(mui_t *ui);
 ^~~~~~~~~~~
 u8g2_u8toa
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:135:41: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_fi(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                         ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:135:60: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_fi(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                                            ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:136:1: error: 'u8g2_uint_t' does not name a type; did you mean 'u8g2_u8toa'?
 u8g2_uint_t mui_u8g2_get_pf_flags(mui_t *ui);
 ^~~~~~~~~~~
 u8g2_u8toa
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:137:41: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_pf(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                         ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:137:60: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_pf(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                                            ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:138:1: error: 'u8g2_uint_t' does not name a type; did you mean 'u8g2_u8toa'?
 u8g2_uint_t mui_u8g2_get_if_flags(mui_t *ui);
 ^~~~~~~~~~~
 u8g2_u8toa
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:139:41: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_if(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                         ^~~~~~~~~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/clib/mui_u8g2.h:139:60: error: 'u8g2_uint_t' has not been declared
 void mui_u8g2_draw_button_if(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
                                                            ^~~~~~~~~~~
In file included from D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:1:
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/MUIU8g2.h:53:17: error: expected ')' before '&' token
     MUIU8G2(U8G2 &u8g2, fds_t *fds, muif_t *muif_list, size_t muif_cnt) {
            ~    ^~
                 )
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/MUIU8g2.h:56:16: error: 'U8G2' has not been declared
     void begin(U8G2 &u8g2, fds_t *fds, muif_t *muif_list, size_t muif_cnt) {
                ^~~~
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/MUIU8g2.h: In member function 'void MUIU8G2::begin(int&, fds_t*, muif_t*, size_t)':
c:\Users\Stefan.Blohm\Documents\Arduino\libraries\U8g2\src/MUIU8g2.h:57:35: error: request for member 'getU8g2' in 'u8g2', which is of non-class type 'int'
       mui_Init(&mui, (void *)u8g2.getU8g2(), fds, muif_list, muif_cnt);
                                   ^~~~~~~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino: At global scope:
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:9:1: error: 'T8' does not name a type
 T8 cmd[5] = {0x55, 0xAA, 0x81, 0x00, 0xFA};  //获取距离指令
 ^~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:13:3: error: 'u8' does not name a type; did you mean 'T8'?
   u8 ErrorCode; //TOF错误码请参考使用说明书
   ^~
   T8
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:16:22: error: too many initializers for 'TF'
 TF Lidar = {0,0,false};
                      ^
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino: In function 'void getLidarData(TF*)':
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:48:16: error: 'struct TF' has no member named 'ErrorCode'
         lidar->ErrorCode  = rx[6];
                ^~~~~~~~~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino: In function 'void loop()':
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:74:18: error: 'cmd' was not declared in this scope
     Serial.write(cmd, 5);
                  ^~~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:74:18: note: suggested alternative: 'chmod'
     Serial.write(cmd, 5);
                  ^~~
                  chmod
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino: In function 'void Port_Print_Ascii(TF*)':
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:87:13: error: 'struct TF' has no member named 'ErrorCode'
   if(lidar->ErrorCode)
             ^~~~~~~~~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:90:31: error: 'struct TF' has no member named 'ErrorCode'
     Port_Debug.println(lidar->ErrorCode,HEX);
                               ^~~~~~~~~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino: In function 'void Port_Print_Benewake_9Byte(TF*)':
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:96:3: error: 'u8' was not declared in this scope
   u8 i = 0;
   ^~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:96:3: note: suggested alternative: 'T8'
   u8 i = 0;
   ^~
   T8
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:97:5: error: expected ';' before 'CheckSum'
   u8 CheckSum = 0;
     ^~~~~~~~~
     ;
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:98:5: error: expected ';' before 'B_9Byte'
   u8 B_9Byte[9];
     ^~~~~~~~
     ;
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:99:3: error: 'B_9Byte' was not declared in this scope
   B_9Byte[0] = 0x59;
   ^~~~~~~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:99:3: note: suggested alternative: 'lowByte'
   B_9Byte[0] = 0x59;
   ^~~~~~~
   lowByte
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:107:7: error: 'i' was not declared in this scope
   for(i=0;i<7;i++){
       ^
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:108:5: error: 'CheckSum' was not declared in this scope
     CheckSum += B_9Byte[i];
     ^~~~~~~~
D:\Hansine Openplotter Projekte\LIDAR Leser\TF-LC02_Lidar_Uart_V1.0\TF-LC02_Lidar_Uart_V1.0.ino:110:16: error: 'CheckSum' was not declared in this scope
   B_9Byte[8] = CheckSum & 0xFF;
                ^~~~~~~~

exit status 1

Compilation error: 'T8' does not name a type

Check that the u8g2 library has been installed successfully.

You can first Google to learn how to install arduino u8g2 library and other familiar with how to install the library.

The SDK for the TF-LC02 does not use the T8.