Skip to content

🐛 [BUG] - Compilation error in M1001.cpp when building for TFT_COLOR_UI: 'ui' was not declared in this scope #173

Description

@tooty-1135

Description

Description

An error occurs during compilation when trying to build the firmware with TFT_COLOR_UI (default UI, without passing -u or -g flags to marlin_builder.sh). The compiler complains that ui is not declared in M1001.cpp.

Reproduction steps

1. Run the build script for a specific machine without UI flags: 
   `bash marlin_builder.sh -m inventor -s`

Screenshots

Logs

liyou@asteroidowo:~/FlashForge_Marlin$ bash marlin_builder.sh -m inventor -s
Flags:  -DFF_EXTRUDER_SWAP -DFF_INVENTOR_MACHINE
Clean...
Build...
Marlin/src/gcode/motion/G2_G3.cpp: In function 'void plan_arc(const xyze_pos_t&, const ab_float_t&, bool, uint8_t)':
Marlin/src/gcode/motion/G2_G3.cpp:270:17: warning: unused variable 'limiting_speed_sqr' [-Wunused-variable]
  270 |                 limiting_speed_sqr = _MIN(sq(limiting_speed), limiting_accel * radius, sq(scaled_fr_mm_s));
      |                 ^~~~~~~~~~~~~~~~~~
Marlin/src/gcode/motion/G2_G3.cpp:271:11: warning: unused variable 'arc_mm_remaining' [-Wunused-variable]
  271 |     float arc_mm_remaining = flat_mm;
      |           ^~~~~~~~~~~~~~~~
In file included from Marlin/src/gcode/sd/../../inc/MarlinConfigPre.h:37,
                 from Marlin/src/gcode/sd/../../inc/MarlinConfig.h:28,
                 from Marlin/src/gcode/sd/M1001.cpp:23:
Marlin/src/gcode/sd/M1001.cpp: In static member function 'static void GcodeSuite::M1001()':
Marlin/src/gcode/sd/../../inc/../core/multi_language.h:68:5: error: 'ui' was not declared in this scope
   68 |     ui.language == 4 ? GET_LANG(LCD_LANGUAGE_5)::MSG : \
      |     ^~
Marlin/src/gcode/sd/../../inc/../core/macros.h:609:26: note: in definition of macro 'THIRD'
  609 | #define THIRD(a,b,c,...) c
      |                          ^
Marlin/src/gcode/sd/../../inc/../core/macros.h:235:29: note: in expansion of macro '___TERN'
  235 | #define __TERN(T,V...)      ___TERN(_CAT(_NO,T),V)  // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
      |                             ^~~~~~~
Marlin/src/gcode/sd/../../inc/../core/macros.h:234:29: note: in expansion of macro '__TERN'
  234 | #define _TERN(E,V...)       __TERN(_CAT(T_,E),V)    // Prepend 'T_' to get 'T_0' or 'T_1'
      |                             ^~~~~~
Marlin/src/gcode/sd/../../inc/../core/macros.h:233:29: note: in expansion of macro '_TERN'
  233 | #define TERN_(O,A)          _TERN(_ENA_1(O),,A)     // OPTION ? 'A' : '<nul>'
      |                             ^~~~~
Marlin/src/gcode/sd/M1001.cpp:100:7: note: in expansion of macro 'TERN_'
  100 |       TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
      |       ^~~~~
Marlin/src/gcode/sd/../../inc/../core/multi_language.h:82:25: note: in expansion of macro 'FPSTR'
   82 | #define GET_TEXT_F(MSG) FPSTR(GET_TEXT(MSG))
      |                         ^~~~~
Marlin/src/gcode/sd/../../inc/../core/multi_language.h:82:31: note: in expansion of macro 'GET_TEXT'
   82 | #define GET_TEXT_F(MSG) FPSTR(GET_TEXT(MSG))
      |                               ^~~~~~~~
Marlin/src/gcode/sd/M1001.cpp:100:73: note: in expansion of macro 'GET_TEXT_F'
  100 |       TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR)));
      |                                                                         ^~~~~~~~~~
*** [.pio/build/FF_F407ZG/src/src/gcode/sd/M1001.cpp.o] Error 1
=============================================================== [FAILED] Took 22.46 seconds ===============================================================

Environment    Status    Duration
-------------  --------  ------------
FF_F407ZG      FAILED    00:00:22.463
========================================================== 1 failed, 0 succeeded in 00:00:22.463 ==========================================================
Build failed

Printer

FlashForge Inventor

Marlin Version

2.0.9.7

Marlin Features

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions