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.

Compiler/CC1350: CCS shared library project - possible bug report

Part Number: CC1350

Tool/software: TI C/C++ Compiler

Hello,

I created a C shared library project using the New->Project wizard and declared it as a dependency to my GCC project (uartecho sample project). Despite the dependency and the subsequent entry in the library search path, the build fails with the error that it cannot find the library (e.g. -lSharedLib).

Michael

  • Please see the Project Dependencies part of the article on builds in CCS.  Note the part where it says "You will still need to manually tell the main project to link in the library file."

    Thanks and regards,

    -George

  • I'm pretty sure that's what I did originally but I just created a test shared library project and declared it as a project dependency, then verified that the dependency was listed in the relevant build settings just to make sure and I still get the error:

    /Applications/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld: cannot find -lTestSharedLibrary

    I have moved on from this by just copying in the files and manually maintaining their versions with the original project. It's not ideal but I can get the build to work.
  • I presume you use the GCC ARM compiler that comes with CCS.  You can find documentation for the linker in a PDF file with a location similar to ...

    C:\ti\ccsv7\tools\compiler\gcc-arm-none-eabi-6-2017-q1-update\share\doc\gcc-arm-none-eabi\pdf\ld.pdf

    In the section titled Command Line Options, you can find a description of the -l (lower case "ell") option.  In your case, I suspect you need to add or modify a -L (upper case "ell") option, in order to tell the linker where to find this library.

    Thanks and regards,

    -George

  • As a bug report/feature request, it would be nice to have that done for me when I associate the projects. That has been my experience with other IDEs.
  • Hi Michael,
    Our pre-Eclipse CCS versions actually supported that functionality. But when when we moved to Eclipse based CCS (CCSv4 and greater), that support was dropped. There was a reason for it but I can't seem to remember the details right now. I'll try to dig them up and see if they are still valid.

    Thanks
    ki
  • I got this working this evening. Here is what I did (for the CC1350):

    1) Create new C project
    2) Right click on project->Properties
    3) Set build to static library
    C/C++ Build>Settings: Build Artifact:: Artifact Type
    ->Static Library
    4) C/C++ Build>Settings: Tool Settings->Miscellaneous:: Other flags


    Required
    -mcpu=cortex-m3

    optional, but potentially relevant:
    -march=armv7-m
    -mthumb
    -mfloat-abi=soft

    5) Optional: Debug
    Tick "Enable Code Composer Breakpoints Support"

    Rebuild project


    In consumer project:

    Right click on project->properties

    1) CCS Build>Dependencies:
    Click Add
    Add reference to the static project

    2) Project References
    Verify that the project references the static project

    Rebuild project