Important: Please read the Qt Code of Conduct -

g++ static library dependency chain

  • Hi!

    Suppose I created a static library libX.a , which is in directory some_path.

    Now I want to create another static library libY.a at the same directory, and I want to "link" libX.a into libY.a, i.e., all the symbols in libX.a to be somehow copied into libY.a. This way, when I link libY.a to a program Z, I do not need to link libX.a to Z too.

    I know I could ar every single symbol of libX.a into libY.a, but I would like to refer to libX.a, and not to its symbols directly.

    Does anyone know how to do it using g++?


  • Lifetime Qt Champion

    @canellas Why do you want to do this? In any case you will need to link your application against both static libraries, so what is the advantage of "copying" symbols from one to another?

Log in to reply