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. creating cpp library using qt
Qt 6.11 is out! See what's new in the release blog

creating cpp library using qt

Scheduled Pinned Locked Moved General and Desktop
23 Posts 3 Posters 20.3k Views 2 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.
  • jsulmJ jsulm

    @amruz Yes. You're using widgets - so it must be a gui application with widgets, right?

    QT += core gui widgets
    
    A Offline
    A Offline
    amruz
    wrote on last edited by
    #21

    @jsulm when i try to include this library in a widget application also i am getting the same error..

    this is the .pro file of my widgetapplication

    #-------------------------------------------------
    #
    # Project created by QtCreator 2017-07-27T17:19:21
    #
    #-------------------------------------------------
    
    QT       += core gui widgets
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = sharedlibtryinwidget
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            mainwindow.cpp
    
    HEADERS  += mainwindow.h
    
    DEPENDPATH += /home/amruz/worksharedlib
    INCLUDEPATH += /home/amruz/worksharedlib
    LIBS += -L/home/amruz/build-worksharedlib-Desktop_Qt_5_7_0_GCC_64bit-Debug -lworksharedlib
    
    
    
    A 1 Reply Last reply
    0
    • A amruz

      @jsulm when i try to include this library in a widget application also i am getting the same error..

      this is the .pro file of my widgetapplication

      #-------------------------------------------------
      #
      # Project created by QtCreator 2017-07-27T17:19:21
      #
      #-------------------------------------------------
      
      QT       += core gui widgets
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      TARGET = sharedlibtryinwidget
      TEMPLATE = app
      
      
      SOURCES += main.cpp\
              mainwindow.cpp
      
      HEADERS  += mainwindow.h
      
      DEPENDPATH += /home/amruz/worksharedlib
      INCLUDEPATH += /home/amruz/worksharedlib
      LIBS += -L/home/amruz/build-worksharedlib-Desktop_Qt_5_7_0_GCC_64bit-Debug -lworksharedlib
      
      
      
      A Offline
      A Offline
      amruz
      wrote on last edited by
      #22

      @amruz i also found that when destructor is not included this type of error may occur..but when i added destructor also the same problem exists

      1 Reply Last reply
      0
      • jsulmJ jsulm

        @amruz Yes. You're using widgets - so it must be a gui application with widgets, right?

        QT += core gui widgets
        
        A Offline
        A Offline
        amruz
        wrote on last edited by amruz
        #23

        @jsulm it worked finally! thanks a lot for all the help

        the problem was qobject in the library , i removed it and it worked.

        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