Simulator error with include or extern var
#include <gui/screen1_screen/Screen1View.hpp>
#include "../../Core/Inc/hello.h" // NO in simulator TouchGFX, Yes in CUBEIDEMX
extern int myvar; // NO in simulator TouchGFX, Yes in CUBEIDEMX
Screen1View::Screen1View()
{
}
void Screen1View::setupScreen()
{
Screen1ViewBase::setupScreen();
}
void Screen1View::tearDownScreen()
{
Screen1ViewBase::tearDownScreen();
}
void Screen1View::simpleFunc()
{
ciao(); // err in simulator TouchGFX
myvar = 7; // err in simulator TouchGFX
}#include "hello.h"
int myvar = 0;
void ciao(void)
{
}#ifndef APPLICATION_USER_HELLO_H_
#define APPLICATION_USER_HELLO_H_
#ifdef __cplusplus
extern "C" {
#endif
void ciao(void);
#ifdef __cplusplus
}
#endif
#endif /* APPLICATION_USER_HELLO_H_ */#include <gui_generated/screen1_screen/Screen1ViewBase.hpp>
#include <touchgfx/Color.hpp>
#include "BitmapDatabase.hpp"
Screen1ViewBase::Screen1ViewBase() :
buttonCallback(this, &Screen1ViewBase::buttonCallbackHandler)
{
box1.setPosition(0, 0, 240, 320);
box1.setColor(touchgfx::Color::getColorFrom24BitRGB(255, 255, 255));
button1.setXY(35, 130);
button1.setBitmaps(touchgfx::Bitmap(BITMAP_BLUE_BUTTONS_ROUND_EDGE_SMALL_ID), touchgfx::Bitmap(BITMAP_BLUE_BUTTONS_ROUND_EDGE_SMALL_PRESSED_ID));
button1.setAction(buttonCallback);
add(box1);
add(button1);
}
void Screen1ViewBase::setupScreen()
{
}
void Screen1ViewBase::buttonCallbackHandler(const touchgfx::AbstractButton& src)
{
if (&src == &button1)
{
//Interaction1
//When button1 clicked call virtual function
//Call simpleFunc
simpleFunc();
}
}Compile in CUBEIDEMX works, run simulator in TOUCHGFX NO
Error in:
#include "../../Core/Inc/hello.h"
or in
extern int myvar;
Thanks