This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R: Using sysconfig auto generated C functions with C++, using the CC2642

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Hello, I am currently working on porting the Adafruit GFX and EPD libraries from arduino to work with the CC2642. I read from previous forums that while C++ is not officially supported, it can be done. I am definitely new to porting libraries and I have run into an issue where a function is defined in a file that is auto generated by sysconfig in C, and is extern -ed in another autogenerated file in C as well. I need this function to work in C++ in my own file, and when I do the usual extern "C" func(); it will not work because it is extern -ed in C in the other file. I cannot edit the autogenerated files as every time I compile they are reset. I am wondering if there is a workaround that I can use or if I have to end up converting all the libraries from C++ to C. Attached below is the code. Any advice on how to port these libraries is also welcome!

Here is the code in my file and the error that it gives when I try to extern "C"

  

Here is where I run the function, and the error it gives when I do not have extern "C" in my file

Here is the other extern that is in the sysconfig auto generated file "ti_ble_config.h"

  • Hi,

    You are correct in your observations. If possible, then I would recommend disabling SysConfig for this project. The Disable Sysconfig chapter of the User's Guide covers this process. This may allow you to do the changes you want to do without having the SysConfig interfere with your modifications.

    Best Regards,

    Jan