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. Problem itegrating Ncreport to my application
Qt 6.11 is out! See what's new in the release blog

Problem itegrating Ncreport to my application

Scheduled Pinned Locked Moved General and Desktop
31 Posts 2 Posters 11.2k Views 1 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 Offline
    A Offline
    advseo32
    wrote on last edited by
    #1

    Hi every body

    i got a probleme when i want to itegrate ncreport to my projects

    her is what i use in .pro file

    @QT = xml sql gui core
    TEMPLATE = app
    CONFIG += warn_on
    qt
    thread
    release
    TARGET = MyApplication
    INCLUDEPATH = ncreport/includes
    HEADERS += ...
    SOURCES += ...
    win32 {
    LIBS += lib/NCReport2.lib
    }@

    Note: my apllication directory is : E:\apprendreQt\gestionstock6

    ncreport includes directory is : E:\apprendreQt\gestionstock6\ncreport\includes

    ncreport lib directory is : E:\apprendreQt\gestionstock6\ncreport\lib

    i get the error
    @
    :-1: erreur : cannot find -l/ncreport2.lib@

    1 Reply Last reply
    0
    • A Offline
      A Offline
      advseo32
      wrote on last edited by
      #2

      Now i got this error

      E:\apprendreQt\gestionstock6\vente.cpp:221: erreur : undefined reference to `_imp___ZN8NCReportC1EP7QObject'

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You should rather have something like this:

        @
        LIBS += -Llib -lNCReport2
        @
        it's a lower case before NCReport2

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • A Offline
          A Offline
          advseo32
          wrote on last edited by
          #4

          i always get the same error

          her is my .pro file after update

          @#-------------------------------------------------

          Project created by QtCreator 2013-08-14T17:44:33

          #-------------------------------------------------

          QT += core gui sql xml

          greaterThan(QT_MAJOR_VERSION, 4){
          QT += widgets printsupport
          DEFINES += HAVE_QT5
          }

          TARGET = gestionstock6
          TEMPLATE = app

          SOURCES += main.cpp
          mainwindow.cpp
          produit.cpp
          customqtablewidget.cpp
          customdelegatecombobox.cpp
          customproxy.cpp
          client.cpp
          bondelivraison.cpp
          chercherproduit.cpp
          chercherclientproduitwidget.cpp
          fournisseur.cpp
          chercherfournisseur.cpp
          vente.cpp

          HEADERS += mainwindow.h
          customqtablewidget.h
          customdelegatecombobox.h
          customproxy.h
          client.h
          bondelivraison.h
          chercherproduit.h
          produit.h
          produit.h
          produit.h
          chercherclientproduitwidget.h
          fournisseur.h
          chercherfournisseur.h
          vente.h

          FORMS += mainwindow.ui
          produit.ui
          client.ui
          bondelivraison.ui
          chercherproduit.ui
          chercherclientproduitwidget.ui
          fournisseur.ui
          chercherfournisseur.ui
          vente.ui

          INCLUDEPATH += "E:\apprendreQt\gestionstock6\includes\include"

          LIBS += -L"E:\apprendreQt\gestionstock6\includes\lib\NCReport2.lib" -lNCReport2
          @

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            No backslash in paths
            And the -L switch is to add a path to the list of searchable location to get libriaries to link.

            @
            LIBS += -L"E:/apprendreQt/gestionstock6/includes/lib" -lNCReport2
            @

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • A Offline
              A Offline
              advseo32
              wrote on last edited by
              #6

              i'm using using Qtcreator with minGW 4.8 compilator

              my libs : NCReport2.lib
              NCReportDebug2.lib

              i tried this but still getting an other error

              @INCLUDEPATH += "E:/apprendreQt/gestionstock6/includes/include"
              LIBS += -L"E:/apprendreQt/gestionstock6/includes/lib"-lNCReport2@

              this is the message in french "Le programme s'est terminé subitement."

              i think is " The program ended suddenly." in english

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                If you want to have the proper lib linked you can use a construct like this

                @
                NCREPORT = NCReport2
                CONFIG(debug, debug|release): NCREPORT = NCReport2Debug
                LIBS += -l$$NCREPORT
                @

                So your can start your application now and you are probably missing some dependencies. Do you have the path to your NCReport2 dll in your PATH ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  advseo32
                  wrote on last edited by
                  #8

                  no, should i include NCReport.dll ??

                  and how i can do this ?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Either edit the PATH variable in the Run panel and add the path where NCReport.dll is contained or copy the dll in your executable folder.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      advseo32
                      wrote on last edited by
                      #10

                      after placing NCReport2.dll with my .exe file , i got the same error

                      “Le programme s’est terminé subitement.”

                      i think is “ The program ended suddenly.” in english

                      this is .pro file

                      @#-------------------------------------------------

                      Project created by QtCreator 2013-08-14T17:44:33

                      #-------------------------------------------------

                      QT += core gui sql

                      greaterThan(QT_MAJOR_VERSION, 4){
                      QT += widgets printsupport
                      DEFINES += HAVE_QT5
                      }

                      TARGET = gestionstock6
                      TEMPLATE = app

                      SOURCES += main.cpp
                      mainwindow.cpp
                      produit.cpp
                      customqtablewidget.cpp
                      customdelegatecombobox.cpp
                      customproxy.cpp
                      client.cpp
                      bondelivraison.cpp
                      chercherproduit.cpp
                      chercherclientproduitwidget.cpp
                      fournisseur.cpp
                      chercherfournisseur.cpp
                      vente.cpp

                      HEADERS += mainwindow.h
                      customqtablewidget.h
                      customdelegatecombobox.h
                      customproxy.h
                      client.h
                      bondelivraison.h
                      chercherproduit.h
                      produit.h
                      produit.h
                      produit.h
                      chercherclientproduitwidget.h
                      fournisseur.h
                      chercherfournisseur.h
                      vente.h

                      FORMS += mainwindow.ui
                      produit.ui
                      client.ui
                      bondelivraison.ui
                      chercherproduit.ui
                      chercherclientproduitwidget.ui
                      fournisseur.ui
                      chercherfournisseur.ui
                      vente.ui

                      INCLUDEPATH += "E:/apprendreQt/gestionstock6/includes/include"
                      LIBS += -L"E:/apprendreQt/gestionstock6/includes/lib"-lNCReport2
                      @

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Then start your program in debug mode with a debugger.

                        This error message just says that the application died not why.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          advseo32
                          wrote on last edited by
                          #12

                          Unfotaintly, i start it in debug mode , and i got this error
                          @during startup program exited with code 0xc0000139@

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Then check that all dlls you might be using can be found at runtime

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              advseo32
                              wrote on last edited by
                              #14

                              i'm using only

                              QT += core gui sql xml

                              and they are present in the C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin

                              and for NCReport lib i have placed with the .exe file in the same directory

                              really i have no idea about this porblem

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                advseo32
                                wrote on last edited by
                                #15

                                Now i getting this error

                                @E:\apprendreQt\gestionstock6\vente.cpp:25: erreur : undefined reference to `_imp___ZN8NCReportC1EP7QObject'

                                E:\apprendreQt\build-gestionstock6-Desktop_Qt_5_1_0_MinGW_32bit-Debug\debug\vente.o:-1: In function `ZN5Vente23on_pushButton_4_clickedEv':

                                E:\apprendreQt\gestionstock6\vente.cpp:222: erreur : undefined reference to `_imp___ZN8NCReport5resetEb'

                                E:\apprendreQt\gestionstock6\vente.cpp:223: erreur : undefined reference to `_imp___ZN8NCReport13setReportFileERK7QString'

                                E:\apprendreQt\gestionstock6\vente.cpp:224: erreur : undefined reference to `_imp___ZN8NCReport20runReportToQtPreviewEv'@

                                this is my implementation of NCreport

                                @void Vente::on_pushButton_4_clicked()
                                {
                                m_report->reset(true);
                                m_report->setReportFile("E:/apprendreQt/build-gestionstock6-Desktop_Qt_5_1_0_MinGW_32bit-Debug/reports/abdeu.xml");
                                m_report->runReportToQtPreview();

                                }@

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  is NCReport also built with mingw ?

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    advseo32
                                    wrote on last edited by
                                    #17

                                    i don't konw ,because i have no exprience with Mingw ,

                                    but i have download the last version from official site for Qt 5.1.0

                                    and his extension is .lib

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #18

                                      Then there's your problem, you are trying to link a library built with VisualStudio while using mingw. The name of the installers from the download section of NCReport is pretty clear.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      0
                                      • A Offline
                                        A Offline
                                        advseo32
                                        wrote on last edited by
                                        #19

                                        yeah i have downloaded all versions

                                        @application/octet-stream NCReport2.10.0_Windows_x86_VS2010_Qt5.1.0_Evaluation.exe (18.0 MB)

                                        application/octet-stream NCReport2.10.0_Windows_x86_VS2010_Qt4.8.5_Evaluation.exe (10.6 MB)

                                        application/octet-stream NCReport2.10.0_Windows_x86_MinGW_Qt4.8.5_Evaluation.exe (14.1 MB)@

                                        i have used the last one but not working for me also

                                        i'm using Qt 5.1.0

                                        plz help me i'm completely lost

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #20

                                          You can't use a library built with Qt 4 if you are using Qt 5 and also AFAIK, you can't link a c++ library from visual studio using mingw. So you have two options:

                                          Change your Qt version and compiler for Visual Studio

                                          Ask the NCReport developer to release a Qt 5 mingw version

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          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