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

creating cpp library using qt

Scheduled Pinned Locked Moved General and Desktop
23 Posts 3 Posters 7.0k 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.
  • J jsulm
    28 Jul 2017, 12:51

    @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 28 Jul 2017, 12:55 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 28 Jul 2017, 13:14
    0
    • A amruz
      28 Jul 2017, 12:55

      @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 28 Jul 2017, 13:14 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
      • J jsulm
        28 Jul 2017, 12:51

        @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 28 Jul 2017, 13:26 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

        21/23

        28 Jul 2017, 12:55

        • Login

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