How to static compile when both the Dynamic Lib and static Lib are in the same path?

  • I'm running into problem of static compiling when both the dynamic and static lib are in the same place.

    e.g. /usr/lib/ and /usr/lib/libfoo.a

    I've tried in the PRO file
    CONFIG +=static
    LIBS += -L/usr/lib -lfoo

    It builds, but not statically

    The only way to get it build statically is for me to remove /usr/lib/ I want to avoid doing this

    I want to use a hard path but can't get it to work. I've tried the following:

    LIBS += -L/usr/lib/libfoo.a
    LIBS+= -L/usr/lib -llibfoo.a
    LIBS+=-L/usr/lib libfoo.a

    How do I specify a hard path to a static lib in the PRO file?


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.