How do I include muparser library in my Qt project?

232 views Asked by At

I made a muparser.pri which had the following content,

macx|win32|equals(build_muparser, "true")|!packagesExist(muparser){
    message("Using bundled muparser")
        MUPARSER_DIR = src/rel/muparser
        DEPENDPATH += $$MUPARSER_DIR/include \
                              $$MUPARSER_DIR/src
       INCLUDEPATH += $$MUPARSER_DIR/include
       GEN_LIB_DIR = ../../generated/lib
       LIBS += -L$$GEN_LIB_DIR -lmuparser
       PRE_TARGETDEPS += $$GEN_LIB_DIR/libmuparser.a
}else{
    message("Using external muparser")
      CONFIG += link_pkgconfig
      PKGCONFIG += muparser
}

I, then, added a

include(./muparser.pri)

in my application's make file.

This gave me an error ":-1: error: No rule to make target '../../generated/lib/libmuparser.a', needed by 'debug/Akaar1.exe'. Stop."

What did I do wrong? How else am I supposed to include this library in my project?

1

There are 1 answers

0
Julián Andrés Guarín Reyes On

In your .pro file you can do:

LIBS += -L*path to the library* -l*library name: foo for libfoo.a*