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.

Unresolved symbol errors - Is CCS really compiling my cpp file?



Hi all,

I have a CCS 4 project, and it basically grew out of a single cpp file that I had to partition things into several .cpp files, as well as .h files. The issue I see is that whenever I define a function inside the .h file, CCS is happy and doesn't give me errors.

But whenever I define the function in a (new) separate .cpp file, I get an unresolved symbol error for that function.

What am I doing wrong and how do I fix it?

How can I make sure my "new" .cpp file is being compiled at all? Looks like CCS is not seeing the implementation in that new file, so it chokes.

Any pointers?

--Dave

  • Hi Dave,

    where are you locating your new files?  I suspect you may simply need to correct the include paths and variables.  Have a look at this wiki and see whether it helps.

    http://processors.wiki.ti.com/index.php/Include_paths_and_options

    Best Regards,

    Lisa

  • Thanks for your answer, but I am using CCS 4 still :( The commands "Project / Link Files to Active Project" or  "Project / Add Files to Active Project" don't offer that many options beyond the file choose window.

    I've tried both without success.

    Again, it's as if my function definitions in my .cpp file are non-existent. However, the .cpp file with the function definitions IS being compiled, since I purposedly created a syntax error in it and surely it is caught by the compiler. When it compiles correctly, all I get are the unresolved symbol errors.

    Anything else I am missing?

  • Hi Dave,

    how exactly have you been adding them? Are they located in the project directory?

    Best Regards,

    Lisa

  • Hi Lisa,

    I have added the .cpp file using the commands mentioned above. 

    The files are in the directory above the project file(s).

  • Hi Dave,

    I have a slightly better idea but are you adding or linking?  Either way ccs still needs to know where the files are.  If you liinked the files, when you right click on the file in the project, and select properties, does the path resolve properly?

    Have you looked in the compiler include options (for adding files)?  Project->Properties->C/C++ Build.    Then under the compiler on the right ... include options.

    Normally an unresolved symbol is from the file search path under the linker (under the compiler)

    Please check these items and keep us informed.

    Best Regards,
    Lisa 

  • Hi Lisa,

    Turns out those functions were declared as "inline"d. The linkage is internal, so they were not visible to the other .cpp files. I had to move those implementations (definitions) to the header file. That worked.

    --Dave

  • Hi Dave,

    ok, thanks for the update and glad to hear you are past the hurdle.

    All the best with development.

    Best Regards,
    Lisa