cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx simulator compile error: 'touchgfx_printf' was not declared in this scope

Wwang.204
Associate

Add debug log in my "Screen1View.cpp" , but report error log as below :

    Compiling gui/src/screen1_screen/Screen1View.cpp

    gui/src/screen1_screen/Screen1View.cpp: In member function 'virtual void Screen1View::buttonUpClicked()':

    gui/src/screen1_screen/Screen1View.cpp:19:3: error: 'touchgfx_printf' was not declared in this scope

      touchgfx_printf("buttonUpClicked\n");

Source code :

\TouchGFX\gui\src\screen1_screen\Screen1View.cpp

....

void Screen1View::buttonUpClicked()

{

 touchgfx_printf("buttonUpClicked\n");

}

...

If this code is commented out , Compiling will be normal .

....

void Screen1View::buttonUpClicked()

{

// touchgfx_printf("buttonUpClicked\n");

}

...

would you give me some suggestions ?

2 REPLIES 2
Wwang.204
Associate

Already fixed , just need include below :

#include <touchgfx/Utils.hpp>

Many thanks

@Romain DIELEMAN​ , the required include file should really be mentioned in the TouchGFX online documentation where the use of touchgfx_printf is described.

With over 200 views, I'm guessing a lot of people have run into this, myself included.