Problem Virtual Function in K22 g++ compiler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem Virtual Function in K22 g++ compiler

1,047 Views
vdavi81_cefla
Contributor I

Hi,

I'm working in a k22 project, and I tried to use a old C++ Library, coming from, another project.

If I try to Compiler this code:

class tFsm
{
public:
tFsm(const T& initial_state) {
Init(initial_state); }

...

....

virtual void Go(const T& next_state) {
_ns = next_state;
}

In RUNT-TIME the code goes in  MemManage_Handler().

If I delete the virtual keyword, the code Run without problems.

Somebody can help me. It's a question of C++ Dialet? Or I have to set some kind of compiling option?

0 Kudos
1 Reply

1,029 Views
RaRo
NXP TechSupport
NXP TechSupport

Hi @vdavi81_cefla,

The virtual keyword is included in the C++ language/dialect for C++ compilers.

Could you please help us check the next information:

  1. MCUXpresso IDE User Guide. Chapter 17. C/C++ Library Support.
  2. How to Switch C/C++ Library in MCUXpresso IDE.

And these posts might be useful: C++ pure virtual class with newlib - NXP Community and From C to C++: Converting Eclipse C Projects | MCU on Eclipse.

Regards, Raul.

0 Kudos