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,148件の閲覧回数
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,133件の閲覧回数
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,119件の閲覧回数
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,113件の閲覧回数
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 件の賞賛