Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    3rd Party Software
    2
    4
    5175
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tryRevilo last edited by

      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**
      
      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        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" ?

        T 1 Reply Last reply Reply Quote 3
        • T
          tryRevilo @mrjj last edited by

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

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @tryRevilo last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post