C project converted to C++ in s32ds for s32k144 board is not working

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

C project converted to C++ in s32ds for s32k144 board is not working

1,577 次查看
sandeepsandeepk
Contributor II

C project converted to C++ in s32ds for s32k144 board is not working.

#ifdef __cplusplus
extern "C" {
#endif

i found that by checking the __cplusplus is not defined for the above area is greyed in s32ds 

please any one help me to solve this.

0 项奖励
回复
3 回复数

1,562 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

when you created new project, did you specify C++ language for that project? 

jiri_kral_0-1606305479157.png

 

Anyway, what is your S32DS Version? 

Jiri

0 项奖励
回复

1,548 次查看
sandeepsandeepk
Contributor II

Hi,

Im using the c/c++ converter to convert the project from c to c++(which is in the File/New/Convert to a C/C++) and not creating new project with c++ supported because i need SDK to generate the driver code.

And im having S32DS Version: 2018.R1
Build id: 180326

0 项奖励
回复

1,542 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

okay. It's not very clear for me - if I understand it correctly - you have project based on SDK (which is C only) and some part written by you in C++, correct? Technically Convert C/C++ adds C++ toolchain in C project: 

jiri_kral_0-1606828768501.png

 

the __cplusplus definition is valid for .cpp sources. So - if you have .cpp source you can use #ifdef __cplusplus - like on my hybrid testing project with main.cpp and .c SDK sources:

jiri_kral_1-1606829089141.png

 

Anyway - what is your use case for mixing C/C++ ?

 

BR,

Jiri

 

 

 

0 项奖励
回复