Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cross-compiling Qt, link order .so & .a ?



  • Hi,

    cross-compiling Qt, I have a thridparty's .a file which changes some functions' implementation of a gcc library.

    for example
    libgcc_a.so is compiler's shared library, i have not libgcc_a.a.
    libmy_a.a is the file i want to use.

    I want to link libmy_a.a first than libgcc_a.so, if a function find in both file.

    Is it possible?



  • Yes...you can change the environment variable path for the lib and put your own before the standard one!



  • Thanks,
    but...which one?

    I add
    LIBS +=-Lpath_to_my_a_lib -lmy_a
    to projects.pro,
    seems not work.

    can you give me more info?



  • Maybe this helps.

    Add the library by path. You will be sure that it's the library you wanna use:
    LIBS += /somepath/libMyQtLib.so

    or try editing as AlterX probably suggested:
    LD_LIBRARY_PATH
    LD_RUNTIME_PATH


Log in to reply