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. [SOLVED] Error in NCReport for Qt 5.1.1 minGW
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Error in NCReport for Qt 5.1.1 minGW

Scheduled Pinned Locked Moved General and Desktop
16 Posts 3 Posters 5.1k 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

    after a long wait NCreport release a compatible version for Qt 5.1.1 minGW

    every thing work perfectyl but after implementation my programme can't start

    her is my code .pro file
    @
    #-------------------------------------------------

    Project created by QtCreator 2013-09-17T18:17:24

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

    QT += core gui sql xml printsupport

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = testncreport
    TEMPLATE = app

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

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    LIBS += "-LE:\apprendreQt\gestionstock6\includes\lib -lNCReport2"
    @

    her is the mainwindow.cpp

    @
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "ncreport.h"
    #include "ncreportpreviewoutput.h"
    #include "ncreportoutput.h"
    #include "ncreportpreviewwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    NCReport *report = new NCReport(this);
    report->reset(true);
    report->setReportFile("E:\apprendreQt\gestionstock6\includes\reports\test.xml");
    report->runReportToPrinter();
    

    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }@

    after compiling i get this error

    @C:\test\testncreport\mainwindow.cpp:14: error: undefined reference to _imp___ZN8NCReportC1EP7QObject' C:\test\testncreport\mainwindow.cpp:15: error: undefined reference to _imp___ZN8NCReport5resetEb'
    C:\test\testncreport\mainwindow.cpp:15: error: undefined reference to _imp___ZN8NCReport5resetEb' C:\test\testncreport\mainwindow.cpp:17: error: undefined reference to _imp___ZN8NCReport18runReportToPrinterEibP7QWidgetRK7QString'
    collect2.exe:-1: error: error: ld returned 1 exit status

    @

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

      Hi,

      Where is your NCReport2 stuff located ?

      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
        #3

        my NCreport2 is located in

        E:\apprendreQt\gestionstock6\includes\lib

        this is the full path

        E:\apprendreQt\gestionstock6\includes\lib\libNCReport2.a

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Remove the quotes in your LIBS variable. At the moment you are specifying a single (broken) -L option.

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

            ok, removing quotes i get another error

            @Starting C:\test\build-testncreport-Qt_5_1_1_MinGW_32_bit_MinGW_4_8_32bit-Debug\debug\testncreport.exe...
            QObject: Cannot create children for a parent that is in a different thread.
            (Parent is MainWindow(0x22fe1c), parent's thread is QThread(0x128ee210), current thread is QThread(0x12927130)
            QPrinter: Must construct a QApplication before a QPaintDevice
            Invalid parameter passed to C runtime function.
            Invalid parameter passed to C runtime function.
            C:\test\build-testncreport-Qt_5_1_1_MinGW_32_bit_MinGW_4_8_32bit-Debug\debug\testncreport.exe exited with code 3@

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

              What does your main.cpp look like ?

              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
                #7

                her is the code of main.cpp @#include "mainwindow.h"
                #include <QApplication>

                int main(int argc, char *argv[])
                {
                QApplication a(argc, argv);
                MainWindow w;
                w.show();

                return a.exec&#40;&#41;;
                

                }
                @

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

                  What happens if you don't pass the parent to when creating a NCReport ?

                  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
                    #9

                    i'm no longer getting the ealier error ,

                    now i get this error

                    @Starting C:\test\build-testncreport-Desktop_Qt_5_1_1_MinGW_32bit-Debug\debug\testncreport.exe...
                    The program has unexpectedly finished.
                    C:\test\build-testncreport-Desktop_Qt_5_1_1_MinGW_32bit-Debug\debug\testncreport.exe exited with code -1073741515@

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

                      You need to run your application with a debugger to see where the error is triggered

                      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
                        #11

                        i get this error
                        @
                        During startup program exited with code 0xc0000135.@

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

                          This is a library not found error, do you have the NCReport dll somewhere in your PATH ?

                          If not, got to the Run panel and update the PATH environment variable adding the path to the folder where that dll can be found.

                          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
                            #13

                            i have placed them before but i get the same error

                            i have deleted the debug folder , then recompile and replace the dll files

                            no it's working for me , but NCreport windows not appears yet only the main windows

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

                              is this code right ?

                              @void MainWindow::on_pushButton_clicked()
                              {
                              NCReport *report = new NCReport(this);
                              report->reset(true);
                              report->setReportFile("E:\apprendreQt\gestionstock6\includes\reports\test.xml");
                              report->runReportToPrinter();
                              }
                              @

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

                                No, you don't escape the backslashes in your path. You either have to to that or since your using Qt, use forward slashes.

                                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
                                  #16

                                  Ok, it works

                                  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