Re: C++ Project using Processor Expert beans

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

Re: C++ Project using Processor Expert beans

1,172 Views
ProcessorExpert
Senior Contributor III

Hello,


Processor Expert (PE) and Device Inititialization (DI) do not support C++ compiler and our drivers are not tested with that compiler. However there is workaround for that. You can create regular C project using usual way and  then you can add your own main.cpp with main function that will be used instead of main.c. Then you have to rename the original main function to another name instead of main. After this you should be able to compile such created project. Just please note that all generated includes of component headers have to be manually copied into new main.cpp file and surrounded by extern “C” {} declaration.  For more details please find attached example project. It may be needed to also set compiler for C++ (for more details please see attachement).

 

best regards
Vojtech Filip
Processor Expert Support Team

0 Kudos
2 Replies

293 Views
robertmadonna
Contributor I

I don't see the attached project.

0 Kudos

293 Views
weberaa
Contributor I

Thanks.

 

I was able to review your model, and based on your feedback decided to simply create a C model containing the processor expert, but force C++ compilation.  This allowed me to encapsulate the C functions with the "#ifdef __cplusplus" extern "C" flag along with the C++ files I needed to import into the project.  So far, the forced C++ compilation seems to have worked, and I'm able to see output at the 115K baud rate that I needed to prove the concept.  My next step is to generate and import the C++ files.