Results 1 to 9 of 9

Thread: realtime_plot example problem--help needed.

  1. #1
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default realtime_plot example problem--help needed.

    hi ppl,
    iam trying to copy the realtime_plot example project into my own folder and trying to execute it.

    iam doing it in windows with QDevelop.

    1. I copied all the .cpp and .h files into my own folder.
    2. Created a new project and added those realtime_plot files to it.
    3. Set the env variables INCLUDEPATH += c:\qwt-5.1.1\include
    LIBS += c:\qwt-5.1.1\lib\libqwt5.a
    4. Set project settings to release and warn on.

    with those settings, i was able to compile it successfully. But when i tried to execute it, its giving error message "The application failed to intialize properly(0xc0000005). Click on OK to terminate the application".

    the project settings file:
    TEMPLATE = app
    SOURCES += realtime.cpp \
    mainwindow.cpp \
    randomplot.cpp \
    incrementalplot.cpp \
    scrollbar.cpp \
    scrollzoomer.cpp
    CONFIG += release warn_on
    HEADERS += mainwindow.h \
    randomplot.h \
    incrementalplot.h \
    realtime.h \
    scrollbar.h \
    scrollzoomer.h
    INCLUDEPATH += c:\qwt-5.1.1\include
    LIBS += c:\qwt-5.1.1\lib\libqwt5.a
    what could be the real mistake i hv done? im trying execute the same example program without any code modification, except with a new .pro file other than the example .pro file.

    Can any body point it out and tell me the problem...thanks in advance.
    Last edited by jacek; 12th July 2008 at 13:23. Reason: added [quote]

  2. #2
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Whats wrong with this simple program...?

    hi ppl,
    it may be a silly problem, but im unable to crack it. pls point it out.

    1. main.cpp
    Qt Code:
    1. #include <QApplication>
    2. #include "mainwindow.h"
    3. int main(int argc,char **argv)
    4. {
    5. QApplication app(argc,argv);
    6. MainWindow win;
    7. win.show();
    8. return app.exec();
    9. }
    To copy to clipboard, switch view to plain text mode 
    2. mainwindow.h
    Qt Code:
    1. #ifndef __MAINWINDOW_H__
    2. #define __MAINWINDOW_H__
    3. #include <QMainWindow>
    4.  
    5. class MainWindow: public QMainWindow
    6. {
    7. public:
    8. MainWindow();
    9. };
    10.  
    11. #endif // __MAINWINDOW_H__
    To copy to clipboard, switch view to plain text mode 
    3. mainwindow.cpp
    Qt Code:
    1. #include "mainwindow.h"
    2. MainWindow::MainWindow()
    3. {
    4. qDebug("Test");
    5. }
    To copy to clipboard, switch view to plain text mode 
    4. randomplot.h
    Qt Code:
    1. #ifndef __RANDOMPLOT_H__
    2. #define __RANDOMPLOT_H__
    3. #include<qwt_plot.h>
    4. class MyPlot: public QwtPlot
    5. {
    6. Q_OBJECT
    7. MyPlot();
    8. };
    9. #endif // __RANDOMPLOT_H__
    To copy to clipboard, switch view to plain text mode 
    5. randomplot.cpp
    Qt Code:
    1. #include "randomplot.h"
    2. MyPlot::MyPlot()
    3. {
    4. qDebug("Indent");
    5. }
    To copy to clipboard, switch view to plain text mode 
    6. plot.pro
    TEMPLATE = app
    SOURCES += main.cpp mainwindow.cpp randomplot.cpp
    HEADERS += mainwindow.h randomplot.h
    CONFIG += release warn_on qt console
    QT += core gui
    INCLUDEPATH += c:\qwt-5.1.1\src
    LIBS += c:\qwt-5.1.1\lib\libqwt5.a
    I successfully, compiled the application on QDevelop on Windows XP. But when i tried to execute it, its giving the following error:
    The application failed to initialize properly (0x0000005). Click on OK to terminate the application.

    whats the problem?
    When i removed the Q_OBJECT macro, its executing properly, no error was coming. whats that silly misake, pls suggest... thanks in advance.....bye
    Last edited by jacek; 12th July 2008 at 13:25. Reason: missing [code] tags

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Whats wrong with this simple program...?

    How did you compile Qwt?

    P.S. Please don't start more than one thread on the same problem. Also, please, use [code] tags.

  4. The following user says thank you to jacek for this useful post:

    swamyonline (13th July 2008)

  5. #4
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: realtime_plot example problem--help needed.

    thanks jacek for replying.
    ya, sure, i will follow code tags from here onwards. and the msg got posted twice accidentally.
    i compiled the program within QDevelop with mingw32-make. the commands i followed within propmpt:

    qmake
    mingw32-make.

    what i noticed is, the example programs given with Qwt are including *.pri files in compilation and iam avoiding them as iam writing a complete new .pro file with proper INCLUDEPATH and LIBS arguments. and also, the example programs r creating a ".rc " file which is not created with this simple application.
    and also i noticed in the example Makefile.Release is , its compiling the resource file with this command

    Qt Code:
    1. obj\realtime_resource_res.o: realtime_resource.rc
    2. windres -i realtime_resource.rc -o obj\realtime_resource_res.o --include-dir=.
    To copy to clipboard, switch view to plain text mode 

    is there anything to do with the resource file. i hv not included the resource file within my sample program...

    pls find it out and suggest me a solution..thank u again.

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: realtime_plot example problem--help needed.

    Quote Originally Posted by swamyonline View Post
    i compiled the program within QDevelop with mingw32-make. the commands i followed within propmpt
    Did you compile Qwt the same way?

    What happens if you change your LIBS variable to:
    LIBS += -Lc:\qwt-5.1.1\lib\ -lqwt5
    ?

  7. The following user says thank you to jacek for this useful post:

    swamyonline (15th July 2008)

  8. #6
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: realtime_plot example problem--help needed.

    jacek,
    sorry, i was out of station. yes, i tried by changing the library options as u mentioned, but there is no change in the problem. still the problem persists.. but, i was successful on Linux. its executing properly. may be some resources options r missing in compiling it on windows. any way thanks for replies and pls let me know if u find solution for the problem..thank u.. bye

  9. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: realtime_plot example problem--help needed.

    Quote Originally Posted by swamyonline View Post
    its executing properly. may be some resources options r missing in compiling it on windows.
    No, it's some problem with DLLs. Have you tried copying qwt5.dll to the directory where the executable is? How do you start the application?

  10. #8
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: realtime_plot example problem--help needed.

    Did you add "DEFINES += QWT_DLL" to your project file ?

    Uwe

  11. The following user says thank you to Uwe for this useful post:

    swamyonline (17th July 2008)

  12. #9
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: realtime_plot example problem--help needed.

    uwe,

    thanks...finally it got solved on windows with that option. i think, i did not go through the qmake basics properly..now its clear.. thank u very much jacek and uwe...great help... keep going , hv a great time..bye
    Last edited by swamyonline; 17th July 2008 at 19:17. Reason: name mistaken

Similar Threads

  1. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.