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.

MSP430 Archiver : Include one .lib in another

Hello,

I am working on CCS5 with a particular architecture: I have a first static library, on which is based a second static library, and finaly my executable project based on the second library.
The problem is that the two static libraries create their own .lib file, and i have to include both into my project linker to make it build.

Is there a way to include the first library into the .lib of the second one?
The goal is to have only one .lib included in my project linker.

Thanks in advance
Antoine



  • Antoine Palaysi said:
    Is there a way to include the first library into the .lib of the second one?

    No.  The format of the library archive file does not support creating directory like hierarchy structures.

    Thanks and regards,

    -George

  • Hi George,

    I think we don't understand each other. I did not mean creating a .lib hierarchically structured. Just having the sources of the first library included in the second one.
    It must be somethings with the settings of the second library archiver. Like in java, when you choose to create a JAR with all dependencies included or not.

    The real problem is this:
    I have a first static library containing hardware related functions for  the MSP430 chip.
    I have a second static library containing functions related to the hardware of my board
    I have a third static library containing business functions
    And my project. The libraries will not change, and diferents projects will be based upon them. So I would like to know if there is a way to make each library include the previous one in it's .lib. So when i build the last and third library I get a .lib with all the others included. That would be better for portability, instead of carraying 3 .lib included in my project.

    Did i explain myself better?

    Best regards
    Antoine

  • There is no tool which walks through the dependencies of your project and automatically works out which libraries are used.  In this case you need to include all 3 libraries in the project.  If it turns out that none of the code or data in a certain library is needed, then the linker effectively ignores that library.

    Thanks and regards,

    -George

  • If you absolutely must have only one library, and there are absolutely no overlapping symbol definitions in the libraries, you can unpack all of the object files from all of the libraries, and create a new library containing all of the object files.  However, you won't gain anything in terms of link speed or code size savings.