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

Qt Plugins: :-1: error: cannot find -lpnp_basictools : UPDATE with .pro files



  • Re: Qt Plugins: :-1: error: cannot find -lpnp_basictools

    I have been trying for days now to use third party libraries in my simple Qt projects, but to no success so far.

    I have tried the Plug & Paint Example and the Plug & Paint Basic Tools Example. The tools/plugandpaint/plugins/basictools/basictools.pro compiles OK, but the tools/plugandpaint/app/app.pro fails to compile:

    :-1: error: cannot find -lpnp_basictools
    collect2.exe:-1: error: error: ld returned 1 exit status
    

    I have practically copy-pasted the sources from the website to my computer. What could I be missing.

    Windows 10

    Qt Creator 3.6.0

    Based on Qt 5.5.1 (MSVC 2013, 32 bit)
    Built on Dec 15 2015 01:01:38
    From revision b52c2f91f5

    LIBS += your_lib_path/your_lib linux:LIBS += -L your_lib_path -lyour_lib win32:LIBS += your_lib_path/your_lib LIBS += -L lib/pcsc/ -lpcsclite LIBS += lib/pcsc/libpcsclite.a 2.add headers INCLUDEPATH += your_include_path INCLUDEPATH += . /usr/local/include)
    

    app.pro

    TARGET = plugandpaint
    DESTDIR = ..
    
    QT += widgets
    
    HEADERS        = interfaces.h \
                     mainwindow.h \
                     paintarea.h \
                     plugindialog.h
    SOURCES        = main.cpp \
                     mainwindow.cpp \
                     paintarea.cpp \
                     plugindialog.cpp
    
    LIBS           = -L../plugins -lpnp_basictools
    
    if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
       mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
       win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
    }
    
    # install
    target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint
    INSTALLS += target
    
    CONFIG += install_ok  # Do not cargo-cult this!
    

    basictoolsplugin.pro

    TEMPLATE      = lib
    CONFIG       += plugin static
    QT           += widgets
    INCLUDEPATH  += ../../app
    HEADERS       = basictoolsplugin.h
    SOURCES       = basictoolsplugin.cpp
    TARGET        = $$qtLibraryTarget(pnp_basictools)
    DESTDIR       = ../../plugins
    
    # install
    target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins
    INSTALLS += target
    
    CONFIG += install_ok  # Do not cargo-cult this!**bolded text**

  • Lifetime Qt Champion

    Hi

    • use third party libraries

    Those are normally NOT Qt plugins but so/dll files ?

    http://doc.qt.io/qt-5/third-party-libraries.html

    Are you trying to make a Qt plugin that uses a external "LIB" ?



  • @mrjj Hi. Thank you for the response. Why is my implementation not working?


  • Lifetime Qt Champion

    @tryRevilo

    Hi
    Im not sure what you are building. If its just a normal Qt plugin and there is no third party libraries also then
    most likely, this is not true

    LIBS = -L../plugins -lpnp_basictools

    it says that from the .pro and one step back there is plugins folder and in that folder
    it can find the plugin called pnp_basictools
    This must be true. The file must be placed there and in that path.


Log in to reply