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.

Linking a library with another library????



We are just creating a FIR xdais compliant algorithm.

On building FIR creates a fir.lib file

we are using another library which contains copying function copy( ) to be invoked from fir library.

we included copy.lib in fir project and then only fir.lib created...

Now the fact is both libraries creates .lib files.

But we are accessing the libraries via a self-written framework project (main.c---another small pjt), which could not identify the function copy() in that library?? i.e.   .out file not created

We included only file search path in framework pjt for fir.lib alone!!!!

Should we have to include search path for  copy.lib also???

fir & copy projects created with both static libraries & legacy COFF format

main.c framework project created with executable format.

  • AmirthaRaj said:

    On building FIR creates a fir.lib file

    we are using another library which contains copying function copy( ) to be invoked from fir library.

    we included copy.lib in fir project and then only fir.lib created...

    Archive libraries are not meant to be used in this type of hierarchical manner. Please see this related post. The best solution would be to include both fir.lib and copy.lib to the framework project.

  • Just based on general practice using libraries... yes, you should include the fir.lib and copy.lib libraries (with search paths) in your main project link settings. The libraries are only accessed during the link step of the build and the  small main project in your example is the only project that would have a link step in order to build the executable.

    The library fir.lib does *not* need to include copy.lib in it's settings because copy.lib will only be used at linked time. fir.lib most likely *will* still need to find copy.lib related include files so it can be compiled, but you probably have already done this since it sounds like fir.lib builds OK.

    So make sure the build of fir.lib can find the copy.lib related include files and then make sure your small main project can find fir.lib include files (and possibly copy.lib include files if there are any copy.lib references in fir.lib include files). Then make sure your small main project can find the copy.lib and fir.lib files during its link step.

    Hope that helps.

  • Hi Aarti,

                I read that article fully. Could it be possible to generate a package with both these libraries to be called from a SDK???.. Under such situation also, should i need to include search path for the internal library(copy.lib in my case) in the framework SDK/?. Or I need to include search path for fir.lib(main library) alone...

    Regards & Thanks,

    K.AmirthaRaj

  • If there are calls from the main project to routines in both the libraries, then yes, both libraries would need to be added to the main project and search paths for both libs needs to be specified.

  • Thanks Aarti. It works great.