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.

Facing problem while including resources from two different project into a third project on Code composer studio

Other Parts Discussed in Thread: CODECOMPOSER

I have a project on codecomposer studio named "test". I have two other projects on CCS named say "x" and "y". To test my test cases i need to include and link the resources of project "x" and project "y" into project "test". I have done that by adding the entries for the project "x" and "y" to the linked resources field in file ".project" of "test" project. But as both the projects "x" and project "y" has their own main functions, i am getting multiple declaration error for main function when i tried to compile the "test" project. I am able to link my other functions from both project "x" and "y" successfuly, but as i cannot rename my main function in any of the project, it is creating the problem. Is there any way to solve this?

Thanks in advance.

  • Hello Shrikant,

    If you want to use functions from the other projects then include only the C file sources that have the function. No, need to to link the entire project X and Y

    Regards
    Amit
  • Amit Ashara said:
    If you want to use functions from the other projects then include only the C file sources that have the function. No, need to to link the entire project X and Y

     Amit, I fear you need a small break from forum or break forum in two level to best serve professional and beginner too.. ;)

     Cannot be intermixed otherwise TI get same beginner level credit too.

     [BEGINNER MODE ANALYSER ON]

    i am getting multiple declaration error for main function when i tried to compile the "test" project. I am able to link my other functions from both project "x" and "y" successfuly, but as i cannot rename my main function in any of the project, it is creating the problem. Is there any way to solve this?

    [MODE OFF]

     Diagnose: -- Syntax errors and form error on language and low knowledge about a c program structure, treat as is and suggest again a C learning course not a specialized forum. Why? We cannot search for silicon problem when this forum is plagued by million request like these!!!

    ----------------- Poster solution ------------------------

     LEARN C to a good level before try to do too much complex things.

     So including more than one main or same if including more than one time same name function result in

      ***  multiple  declaration error ***

     From this I infer our poster is again a beginner so:

     Rename all main to main_xxx where xxx unique postfix belong to  just one of your project,

     add a function All_main_init then MOVE all initilization code from  main_xxx to there removing same functioning lines  and grouping same code.

     Move all shared variable to global (Bad practice) or declare as static into old main (they remain local to main)

     Modify all old main if looped to be callable in short time and if more than one section exist modify in term to be polled instead of loop...

     When all ol main are ready to be polled to then you can call repeatedly in a super loop fashion:

     Write a new main then call

    int main ()

    {

       All_main_init();

      for(;;) // forever

      {

        main_xx1();

        main_xx2();

       ....

       main_xxn();

      }

    }

     *** Forever this is a lack of basic knowledge and not a TIVA C related question ***

     Amit please ask your sturdy commercial is not so useful to waste all our resource this way and professional image of this firm get as low as this question is. Trouble is not poster is how forum is perceived.