Processor expert not available when .cpp files are used ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Processor expert not available when .cpp files are used ?

1,028 次查看
karthick1987
Contributor II

Hi guys,

I tried making a project with .c,.cpp and .asm files and the processor expert would not be included in the project! Is there a way to add the processor expert files into it?

I tried file -> New -> other -> processor expert -> enable processor expert for existing C project and it successfully added Device initialization component to the project but when I compiled I got the following errors

DescriptionResourcePathLocationType
C1834 Indirection applied to non-pointerMCUinit.c/DZ128_work/Sourcesline 154C/C++ Problem
C2450 Expected:  . * + - & ! ~ ++ -- -> [ ( :: IDENT CONSTANT STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__ delete new throwMCUinit.c/DZ128_work/Sourcesline 154C/C++ Problem
C2801 ')' missingMCUinit.c/DZ128_work/Sourcesline 154C/C++ Problem
mingw32-make: *** [Sources/MCUinit_c.obj] Error 1DZ128_workC/C++ Problem

Please advise

Regards

K

0 项奖励
回复
1 回复

781 次查看
BlackNight
NXP Employee
NXP Employee

Hello,

Processor Expert generated code is plain C code, and cannot be compiled in C++ mode.

Make sure you compile all Processor Expert files in C mode.

Additionally, this article might help: Processor Expert, gcc C++ and Kinetis-L with MQXLite | MCU on Eclipse

(although I see you are using S08, but the principles apply to the S08 as well).

It is much easier if you create a project with Processor Expert and C, and then add your C++ files to it (and compile them in C++ mode). The only thing you need to be careful is that you make sure you call your global constructors (or add that to the startup code). If you are not constructing global objects, then this is not necessary.

Hope this helps,

Erich

0 项奖励
回复