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 3.3 C/C++ library generation

[Problem]:

Using CCS 3.3, TI DSP C6727, when generate a C/C++ library, how statically embedded (or to say, add in) another library.

[More detailed description]:

We generate two C/C++ Library (int.lib and ext.lib).  "int.lib" is an intermediate library, which is visiable to "ext.lib" only and not available in link stage. "ext.lib" is for linker to generate an executive program.

Our problem now is when linking, some functions defined in "int.lib" cannot be resolved. How can we achieve that without linking failure? Is there any relevant doc such as application note?

Thanks in advance

BTW,

The C/C++ source code has not problem, because if we put all source code together to generate one library and link, there is no problem.

 

  • These int.lib and ext.lib files, are they libraries you are building with the archiver ar6x?  Or, are they partially linked object files built with the linker lnk6x (or "cl6x -z")?

    Also, this wiki article may help.

    Thanks and regards,

    -George

  • I use CCS to configure the build option. I think, the underlying build process ueses both "ar6x" and "cl6x" commands, but does not use "cl6x -z" option.

    To make sure my question was presented clearly, I illustrate it by using the below example.

    1> "int.lib" generated by Team A and released to Team B.

    2> After Team B receives "int.lib", they will generate "ext.lib" and release to TeamC.

    The project file of "ext.lib" includes "ext1.c", "ext2.c" and "int.lib", where "ext1.c", "ext2.c" are source code and call some functions inside "int.lib".

    3> After Team C receives "ext.lib", they will generate an executive program, such as exe.out.  

    Team C has "ext.lib" only. "int.lib" is invisible to them. How to make the final link successfully?

  • Object libraries such as ext.lib and int.lib cannot model any kind of hierarchy.  That is, ext.lib cannot somehow contain int.lib.  Neither can ext.lib somehow refer to int.lib.  An object library can contain only a flat list of object files.  Think of it like a directory that can contain only files, and not other directories.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for your reply.

    Using the same example as above, Is there any way for Team B to generate an "ext.lib" with re-organization of all object files inside "int.lib" plus "ext1.obj" and "ext2.obj"?

    In the example, source code belonging to different teams are not accessible by the other teams. Then, any recommended solution?

    Thanks.

  • Jun Xie said:
    Using the same example as above, Is there any way for Team B to generate an "ext.lib" with re-organization of all object files inside "int.lib" plus "ext1.obj" and "ext2.obj"?

    There is a way to do it.  But, so far as I know, it cannot be done within a CCS project.  You have to do it manually on the command line.  It is not that difficult, just unusual.  It is much easier to supply both int.lib and ext.lib to Team C.

    Thanks and regards,

    -George

  • Could you be kind enough to provide an example for command line or all relevant command and option, which will help me avoid a wrong direction?

  • These commands will create an object library named ext.lib, which contains all of the object files from the library int.lib, as well as additional object files from Team B.

    Start in an empty directory.

    % ar6x -x /path/to/int.lib
    % copy all the object files produced by team B .
    % ar6x -r ext.lib *

     The first command extracts all the object files from int.lib.  The last command creates ext.lib.

    Even though this is not that difficult, I still contend it is not very useful.  Just supply both int.lib and ext.lib to team C.

    Thanks and regards,

    -George

  • Is the proposed command line archiver code giving you same result or it adds the int library to the external library???

  • Same result as what?  That set of commands will create a library which contains object modules from both int.lib and team B.  Once those modules are combined into that library, there is no built-in way to tell them apart, or somehow know where they came from.

    Thanks and regards,

    -George