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. Why Qt can't detect library from /usr/lib...
Forum Updated to NodeBB v4.3 + New Features

Why Qt can't detect library from /usr/lib...

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 4 Posters 5.2k Views 3 Watching
  • 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.
  • A Abrar
    29 Aug 2018, 06:48
    #-------------------------------------------------
    #
    # Project created by QtCreator 2018-08-20T09:12:54
    #
    #-------------------------------------------------
    
    QT       += core gui widgets
    
    TARGET = help
    TEMPLATE = app
    
    # library for theme
    unix:!macx: LIBS += -lcprime
    unix:!macx: LIBS += -lcsys
    
    SOURCES += \
        main.cpp \
        help.cpp
    
    HEADERS += \
        help.h
    
    FORMS += \
        help.ui
    
    RESOURCES += \
        icons.qrc
    
    # Disable warnings, enable threading support and c++11 
    CONFIG += thread silent build_all c++11
    
    # Disable Debug on Release
    # CONFIG(release):DEFINES += QT_NO_DEBUG_OUTPUT
    
    # Build location
    
    BUILD_PREFIX = $$(CA_BUILD_DIR)
    
    isEmpty( BUILD_PREFIX ) {
            BUILD_PREFIX = ./build
    }
    
    MOC_DIR       = $$BUILD_PREFIX/moc-qt5
    OBJECTS_DIR   = $$BUILD_PREFIX/obj-qt5
    RCC_DIR	      = $$BUILD_PREFIX/qrc-qt5
    UI_DIR        = $$BUILD_PREFIX/uic-qt5
    
    
    unix {
            isEmpty(PREFIX) {
                    PREFIX = /usr
            }
            BINDIR = $$PREFIX/bin
    
            target.path = $$BINDIR
    
            desktop.path = $$PREFIX/share/applications/
            desktop.files = "Help CoreApps.desktop"
    
            icons.path = $$PREFIX/share/coreapps/icons/
            icons.files = icons/Help.svg
    
            INSTALLS += target icons desktop
    }
    
    DEFINES += QT_DEPRECATED_WARNINGS
    DEFINES += "HAVE_POSIX_OPENPT"
    

    This is the .pro file of my application.
    And my 1st library

    QT       += widgets core network gui charts concurrent dbus
    
    TARGET = csys
    TEMPLATE = lib
    
    # disable all build warnings
    CONFIG += silent warn_on static
    
    # Disable Debug on Release
    #CONFIG(release):DEFINES += QT_NO_DEBUG_OUTPUT
    
    VERSION = 1.0.10
    DEFINES += LIBCSYS_LIBRARY
    
    HEADERS += \
        csys/cpu_info.h \
        csys/disk_info.h \
        csys/memory_info.h \
        csys/network_info.h \
        csys/process.h \
        csys/process_info.h \
        csys/system_info.h \
        csys/command_util.h \
        csys/file_util.h \
        csys/format_util.h \
        csys/battery.h \
        csys/info_manager.h \
        csys/upower.h \
        csys/udisks2.h \
        libcsys_global.h
    
    SOURCES += \
        csys/cpu_info.cpp \
        csys/disk_info.cpp \
        csys/memory_info.cpp \
        csys/network_info.cpp \
        csys/process.cpp \
        csys/process_info.cpp \
        csys/system_info.cpp \
        csys/command_util.cpp \
        csys/file_util.cpp \
        csys/format_util.cpp \
        csys/battery.cpp \
        csys/info_manager.cpp \
        csys/upower.cpp \
        csys/udisks2.cpp
    
    MOC_DIR			= ../build/moc
    OBJECTS_DIR		= ../build/obj
    RCC_DIR			= ../build/qrc
    UI_DIR			= ../build/uic
    
    unix {
            isEmpty(PREFIX) {
                    PREFIX = /usr
            }
    
            INSTALLS	+= target includes
            CONFIG		+= create_pc no_install_prl link_pkgconfig
            contains(DEFINES, LIB64): target.path = $$INSTALL_PREFIX/lib64
            else: target.path = $$INSTALL_PREFIX/lib
    
            target.path			= $$PREFIX/lib/
            includes.files	                = libcsys_global.h csys/*.h
            includes.path		        = $$PREFIX/include/csys
    
            QMAKE_PKGCONFIG_NAME = libcsys
            QMAKE_PKGCONFIG_DESCRIPTION = Library for coreapps
            QMAKE_PKGCONFIG_PREFIX  = $$INSTALL_PREFIX
            QMAKE_PKGCONFIG_LIBDIR  = $$target.path
            QMAKE_PKGCONFIG_INCDIR  = $$includes.path
            QMAKE_PKGCONFIG_VERSION = $$VERSION
            QMAKE_PKGCONFIG_DESTDIR = pkgconfig
    }
    

    And 2nd Library is

    QT       += widgets core gui
    
    TARGET    = cprime
    TEMPLATE  = lib
    
    # disable all build warnings
    CONFIG   += silent warn_on thread silent build_all c++11
    
    DEFINES  += LIBCPRIME_LIBRARY
    
    INCLUDEPATH += ./cprime/
    DEPENDPATH  += ./cprime/
    
    # Disable Debug on Release
    #CONFIG(release):DEFINES += QT_NO_DEBUG_OUTPUT
    
    VERSION  = 1.1.1
    DEFINES += LIBCPRIME_LIBRARY
    
    MOC_DIR			= ../build/moc
    OBJECTS_DIR		= ../build/obj
    RCC_DIR			= ../build/qrc
    UI_DIR			= ../build/uic
    
    unix {
            isEmpty(PREFIX) {
                    PREFIX = /usr
            }
    
            INSTALLS	 += target includes data themefiles
            CONFIG		 += create_pc no_install_prl link_pkgconfig
            contains(DEFINES, LIB64): target.path = $$INSTALL_PREFIX/lib64
            else: target.path = $$INSTALL_PREFIX/lib
    
            target.path	  = $$PREFIX/lib/
    
            includes.files    = cprime/*.h libcprime_global.h
            includes.path     = $$PREFIX/include/cprime/
    
            data.path         = $$PREFIX/share/coreapps/docs
            data.files        = docs/Changelog docs/LICENSE docs/To-Do.txt
    
            themefiles.path   = $$PREFIX/share/coreapps/Theme
            themefiles.files  = style/*.qss style/*.ini
    
            QMAKE_PKGCONFIG_NAME        = libcprime
            QMAKE_PKGCONFIG_DESCRIPTION = Library for coreapps
            QMAKE_PKGCONFIG_PREFIX      = $$INSTALL_PREFIX
            QMAKE_PKGCONFIG_LIBDIR      = $$target.path
            QMAKE_PKGCONFIG_INCDIR      = $$includes.path
            QMAKE_PKGCONFIG_VERSION     = $$VERSION
            QMAKE_PKGCONFIG_DESTDIR     = pkgconfig
    }
    
    HEADERS += \
        cprime/globalfunctions.h \
        cprime/utilities.h \
        cprime/settingsmanage.h \
        cprime/bookmarkmanage.h \
        cprime/bookmarkdialog.h \
        libcprime_global.h \
    
    SOURCES += \
        cprime/globalfunctions.cpp \
        cprime/utilities.cpp \
        cprime/settingsmanage.cpp \
        cprime/bookmarkmanage.cpp \
        cprime/bookmarkdialog.cpp
        
    FORMS += \
        cprime/bookmarkdialog.ui
    
    S Offline
    S Offline
    saber
    wrote on 30 Aug 2018, 02:35 last edited by
    #21

    @Abrar i think you should check if it is installed earlier in other places by you while you are testing.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Abrar
      wrote on 30 Aug 2018, 04:35 last edited by
      #22

      That's not installed anywhere else. But the thing is, i found this problem on xubuntu 18.04 at Qt 5.9. But i tried this on Ubuntu 18.04 at Qt 5.9 and it works without typing
      -L/usr/lib
      i think i have to use -L/usr/lib for me...
      And i found my solution. Like
      LIBS += -L/usr/lib -llibraryname
      Thanks all of you...

      1 Reply Last reply
      0

      21/22

      30 Aug 2018, 02:35

      • Login

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