Important: Please read the Qt Code of Conduct -

plugin example app launch problem :-1: error: cannot find -lpnp_basictools

    I want to learn this example about working with plugins but I am getting :-1: error: cannot find -lpnp_basictools in issues window.
    I try to build assuming that this Lib is needed, but when I try to make install this plugin I get errors of GNU Make

    make -f Makefile.Release install
    make[1]: Entering directory `C:/Qt/Examples/Qt-5.5/widgets/tools/plugandpaintplugins/build-basictools-Desktop_Qt_5_5_1_MinGW_32bit-Release'
    copy /y ..\..\plugandpaint\plugins\libpnp_basictools.a C:\Qt\Examples\Qt-5.5\widgets\tools\plugandpaint\plugins\libpnp_basictools.a
    ЌҐў®§¬®¦­® бЄ®ЇЁа®ў вм д ©« Ї®ўҐае б ¬®Ј® ᥡп.
    ‘Є®ЇЁа®ў ­® д ©«®ў:         0.
    make[1]: Leaving directory `C:/Qt/Examples/Qt-5.5/widgets/tools/plugandpaintplugins/build-basictools-Desktop_Qt_5_5_1_MinGW_32bit-Release'

    what problem it might be?

  • Lifetime Qt Champion


    What is that error message saying ?


    impossible to copy files over existing.
    files copied: 0

    but if I take away existing:

    make  (e=2): Unable to fide specified file.
    make[1]: *** [..\..\plugandpaint\plugins\libpbp_basictools.a] Error 2
    make[1]: ...
    make: *** [release-install] Error 2

  • Lifetime Qt Champion

    Looks a bit like a permission issue

  • run make install with highets rights and files atributes are changeable and result as above.
    Do you run this example succesfully?

  • Lifetime Qt Champion

    Yes, I do.

    Did you first build the Plug and Paint plugins ?

  • @SGaist hi, I tried on other device with Qt 5.5.1 and got the same result.
    What exact steps did you do to make it work? Did it work from abox or you built plugins and installed them?
    I did not install plugins because make returns errors as I showed.

  • Lifetime Qt Champion

    First build the Plug and Paint Plugins example and then the Plug and Paint example itself.

  • @SGaist , dear, there is question about plug and paint example. I tried to build pluging on another pc with fresh windows and the same errors with error of make install, Please correct me if I do wrong.

    1. open plug and paing basic tools project
      2, build it succesfully
    2. go to folder with the build and run make install and it returns errors. (compile output)
    C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lpnp_basictools
    collect2.exe: error: ld returned 1 exit status
    Makefile.Release:94: recipe for target 'release\plugandpaint.exe' failed
    mingw32-make[1]: *** [release\plugandpaint.exe] Error 1
    mingw32-make[1]: Leaving directory 'C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaint-Desktop_Qt_5_5_1_MinGW_32bit-Release'
    makefile:34: recipe for target 'release' failed
    mingw32-make: *** [release] Error 2
    00:09:46: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project plugandpaint (kit: Desktop Qt 5.5.1 MinGW 32bit)
    When executing step "Make"

    am I missing something some steps??

  • Lifetime Qt Champion

    First build/install the project that can be found in examples/widgets/tools/plugandpaintplugins/and only after that build your Plug And Paint example.

  • @SGaist
    what make install shows

    cd basictools\ && ( if not exist Makefile C:\Qt\5.5\mingw492_32\bin\qmake.exe C:\Qt\Examples\Qt-5.5\widgets\tools\plugandpaintplugins\basictools\ -spec win32-g++ -o Makefile ) && make -f Makefile install
    make[1]: Entering directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/basictools'
    make -f Makefile.Release install
    make[2]: Entering directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/basictools'
    copy /y ..\..\plugandpaint\plugins\libpnp_basictools.a C:\Qt\Examples\Qt-5.5\widgets\tools\plugandpaint\plugins\libpnp_basictools.a
    impossible to copy files over existing.
    files copied: 0.
    make[2]: Leaving directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/basictools'
    make[1]: Leaving directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/basictools'
    cd extrafilters\ && ( if not exist Makefile C:\Qt\5.5\mingw492_32\bin\qmake.exe C:\Qt\Examples\Qt-5.5\widgets\tools\plugandpaintplugins\extrafilters\ -spec win32-g++ -o Makefile ) && make -f Makefile install
    make[1]: Entering directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/extrafilters'
    make -f Makefile.Release install
    make[2]: Entering directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/extrafilters'
    copy /y ..\..\plugandpaint\plugins\pnp_extrafilters.dll C:\Qt\Examples\Qt-5.5\widgets\tools\plugandpaint\plugins\pnp_extrafilters.dll
    impossible to copy files over existing.
    files copied: 0
    make[2]: Leaving directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/extrafilters'
    make[1]: Leaving directory `C:/Qt/Examples/Qt-5.5/widgets/tools/build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release/extrafilters'

    I think there is some problems with paths, but I do not understand what is wrong.

  • Lifetime Qt Champion

    Do you have enough space left ?

  • @SGaist I have never faced with such a problem....
    yes, I do have space....
    If I delete all files from target directory C:\Qt\Examples\Qt-5.5\widgets\tools\plugandpaint\plugins and run make install I get the listing as in my previous post with errors of gnu make, but in the target directory will be files:

    15.03.2016  21:50            32 922 libpnp_basictools.a
    15.03.2016  21:50             2 216 libpnp_extrafilters.a
    15.03.2016  21:50            23 552 pnp_extrafilters.dll

    however Plug and Paint example is not being compiled, still cannot find -lpnp_basictools
    Please show your make install output and what files in target directory.

  • Lifetime Qt Champion

    Are you doing it from the command line or Qt Creator ?

  • @SGaist building plugins with qt creator, installing by make install

  • Lifetime Qt Champion

    Where are you calling make install ?

  • @SGaist cmd

    cd C:\Qt\Examples\Qt-5.5\widgets\tools\build-plugandpaintplugins-Desktop_Qt_5_5_1_MinGW_32bit-Release
    make install

  • Lifetime Qt Champion

    Which cmd ?

  • @SGaist said:

    Which cmd ?

    WINDOWS Command prompt
    is it wrong way to use external gnu make?

  • Lifetime Qt Champion

    IIRC you should have a MinGW ready command line shortcut in the Qt Start menu entry.

  • @SGaist I instaled Qt 5.6, now I install plugins succesfully but it does not matter as all plugins already built stays in Plug & Paint example folder /plugins.
    However when building Plug & Paint example is says :-1: error: cannot find -lpnp_basictools
    even if /plugins contains

    17.03.2016  18:22    <DIR>          .
    17.03.2016  18:22    <DIR>          ..
    17.03.2016  20:58            32 706 libpnp_basictools.a
    17.03.2016  02:38           920 206 libpnp_basictoolsd.a
    17.03.2016  02:34             2 216 libpnp_extrafilters.a
    17.03.2016  18:22             2 226 libpnp_extrafiltersd.a
    17.03.2016  20:58            23 552 pnp_extrafilters.dll
    17.03.2016  18:22           824 956 pnp_extrafiltersd.dll

    Why Run of plugandpaint in QtCreator may give this message?

  • Lifetime Qt Champion

    Because it can't find the plugin files.

    One thing you could to is add the path to them to the example .pro file.

  • @SGaist great thx for you for assist.
    I change default .pro config

    LIBS           = -Lplugins -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


    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/plugins/ -lpnp_basictools
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/plugins/ -lpnp_basictoolsd
    else:unix: LIBS += -L$$PWD/plugins/ -lpnp_basictools
    INCLUDEPATH += $$PWD/plugins
    DEPENDPATH += $$PWD/plugins
    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/plugins/libpnp_basictools.a
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/plugins/libpnp_basictoolsd.a
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/plugins/pnp_basictools.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/plugins/pnp_basictoolsd.lib
    else:unix: PRE_TARGETDEPS += $$PWD/plugins/libpnp_basictools.a

    generated with QtCreator tool, and it works
    I am not really sure why it works when default code did not.

  • I have the same problem running on Ubuntu, on windows 8 otherwise i have no problems :\ , if i build first the plugin and after the application it works just fine

  • problem solved downloading Qt 5.6 :\

Log in to reply