Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. what is the "../" meaning in 'LIBS = -L../plugins' when load plugins

what is the "../" meaning in 'LIBS = -L../plugins' when load plugins

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 484 Views
  • 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.
  • P Offline
    P Offline
    Princein
    wrote on last edited by
    #1

    hello:
    I learn load plugin in qt in mac by following the 'Plug & Paint Example' which is in Qt's example, so I create a new project to follow the 'Plug & Paint Example' project, in the app.pro which belongs to 'Plug & Paint Example' project, here is app.pro the information :

    #! [0]
    TARGET = plugandpaint
    DESTDIR = ..

    QT += widgets

    HEADERS = interfaces.h
    mainwindow.h
    paintarea.h
    plugindialog.h
    interfaces.h
    SOURCES = main.cpp
    mainwindow.cpp
    paintarea.cpp
    plugindialog.cpp

    LIBS = -L../plugins
    macx-xcode {
    LIBS += -lpnp_basictools$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})
    } else {
    LIBS += -lpnp_basictools
    message($$member(LIBS, 0)----$$member(LIBS, 1))
    if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
    mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
    # mac:LIBS = $$member(LIBS, 0)_debug -L../plugins
    win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)
    }
    }
    #! [0]

    install

    target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint
    INSTALLS += target

    CONFIG += install_ok # Do not cargo-cult this!

    when I run the 'Plug & Paint Example' project, everything works fine just as we expect,

    so I follow the 'Plug & Paint Example' project create a new project which name 'PlugAndPaintExample',

    here is my PlugAndPaintExample.pro in the 'PlugAndPaintExample' project:

    TARGET = PlugAndPaintExample
    DESTDIR = ..

    QT += widgets

    HEADERS +=
    interfaces.h
    mainwindow.h
    paintarea.h
    plugindialog.h

    SOURCES +=
    mainwindow.cpp
    paintarea.cpp
    plugindialog.cpp
    main.cpp

    LIBS += -L../plugins
    macx-xcode {
    LIBS += -lpnp_basictools$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})
    } else {
    LIBS += -lpnp_basictools
    message($$member(LIBS, 0)----$$member(LIBS, 1))
    if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
    mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
    # mac:LIBS = $$member(LIBS, 0)_debug -L../plugins
    win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)
    }
    }

    install

    target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint
    INSTALLS += target

    CONFIG += install_ok # Do not cargo-cult this!

    when I run the PlugAndPaintExample project,it will show me the error:

    ld: warning: directory not found for option '-L../plugins'
    ld: library not found for -lpnp_basictools_debug
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I confirm I had added the plugins directory in the correct path, why in my 'PlugAndPaintExample' it shows the error,but the 'Plug & Paint Example' won't,
    after that, I change 'LIBS = -L../plugins' to 'LIBS =-L$$PWD/../plugins' in PlugAndPaintExample.pro in the 'PlugAndPaintExample' project, it works fine, I don't know why, this makes me confused.
    thanks a lot!

    1 Reply Last reply
    0
    • W Offline
      W Offline
      wrosecrans
      wrote on last edited by wrosecrans
      #2

      "../" means the parent directory of the current directory. So if the current directory was /home/bob/Documents, "../" would mean /home/bob, just like when you 'cd ..' on the command line.

      P 1 Reply Last reply
      5
      • W wrosecrans

        "../" means the parent directory of the current directory. So if the current directory was /home/bob/Documents, "../" would mean /home/bob, just like when you 'cd ..' on the command line.

        P Offline
        P Offline
        Princein
        wrote on last edited by
        #3

        @wrosecrans
        thanks for your help!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved