Problem Virtual Function in K22 g++ compiler

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem Virtual Function in K22 g++ compiler

1,737件の閲覧回数
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 件の賞賛
返信
1 返信

1,719件の閲覧回数
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 件の賞賛
返信