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.

TMS320F28388D: How to add a C++ file to a C project

Part Number: TMS320F28388D


I want to create a C++ project for the TMS320F28388D, but Code Composer gives no option for C++ project, so, instead, I created a C project and tried to add a C++ file (.cpp) to the C project using File | New |Source File and Code Composer added the .cpp file automatically inserting a file header at the top of the .cpp page with the file name, date created, and author.

I then added a simple function defined as int trial1(int m) to the .cpp file and tried to Build the project, and the project built successfully.

Next, I placed a prototype for the trial1()  function in the main.c file (generated automatically by Code Composer), and the project built successfully.

But then I tried to add trial1() in main(), and the project would not build. I got this error message during linking:

undefined symbol trial 1  first referenced in file ./main.obj

error #10234-D: unresolved symbols remain

error #10010: errors encounterd during linking: myProject.out" not built.

It looks like the linker does not see the trial1() function in my .cpp file.

How do I get the linker do see the function in the .cpp file and link?

Thanks.