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.

CCS/TMS570LC4357: Generating a C/C++ static library in Code Composer

Part Number: TMS570LC4357


Tool/software: Code Composer Studio

I have a project that has a mix of both C and C++ files. I would like to make a static library so that another user can call the C functions and the public C++ functions. I tried following this example https://www.youtube.com/watch?v=FzHtq51IjDM  but I was only able to make calls to the C functions compile, calls to the C++ functions did not compile. Additionally, when I called the C functions the program compiled and ran but I was not able to set a breakpoint in the program to check that the C functions were working correctly and the when I ran the program it did not stop before entering main.

Is it possible to make a static library that has mixed C/C++ functions? Why did my program not stop before entering main when I ran it? 

  • Library or not, when mixing C and C++ code together, there are some rules to follow.  Please see this FAQ (not from TI).  

    If that doesn't fix your problem, then for ...

    Christian Tuchez said:
    calls to the C++ functions did not compile

    ... please show the compiler diagnostics you see.

    Thanks and regards,

    -George

  • After checking the "treat C files as C++ files" option the problem went away.
    I am still having the issue of the program not stopping before entering main and not hitting any breakpoints. I wonder if this has something to do with having a main file in the static library and then another main file in the program that is calling the static library. Do you think this could have something to do with the problem?
  • I presume you get a clean build.  That being the case, the file in the static library which defines the function main is not part of your program.  So, that has no connection to the problem.

    Thanks and regards,

    -George