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

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

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

1,671 Views
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 Kudos
Reply
3 Replies

1,656 Views
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 Kudos
Reply

1,642 Views
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 Kudos
Reply

1,636 Views
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 Kudos
Reply