Results 1 to 4 of 4

Thread: [QT] I can't debug my applications

  1. #1
    Join Date
    Jul 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Arrow [QT] I can't debug my applications

    Hello guys, I'm new here. I hope you can help me.

    I'm using code::blocks with QT and MinGW installed on Windows Xp.

    I've done a new QT4 project and specified the QT folder.

    The c++ code is ok, because I can compile by terminal the release and it works.

    I get a lot of errors building and running the debug: it doesn't link the QT libraries. How I can specify the right place where to pick them to codeblock?

    Thank you, C.

    p.s.

    CODE:

    Qt Code:
    1. #include <QApplication>
    2. #include <QFont>
    3. #include <QPushButton>
    4. #include <QWidget>
    5.  
    6. class MyWidget : public QWidget
    7. {
    8. public:
    9. MyWidget(QWidget *parent = 0);
    10. };
    11. MyWidget::MyWidget(QWidget *parent)
    12. : QWidget(parent)
    13. {
    14. setFixedSize(200, 120);
    15.  
    16. QPushButton *quit = new QPushButton(tr("Quit"), this);
    17. quit->setGeometry(62, 40, 75, 30);
    18. quit->setFont(QFont("Times", 18, QFont::Bold));
    19.  
    20. connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));
    21. }
    22. int main(int argc, char *argv[])
    23. {
    24. QApplication app(argc, argv);
    25. MyWidget widget;
    26. widget.show();
    27. return app.exec();
    28. }
    To copy to clipboard, switch view to plain text mode 
    ERROR:

    C:\Projects\uno\Ciao.cc|1|QApplication: No such file or directory|
    C:\Projects\uno\Ciao.cc|2|QFont: No such file or directory|
    C:\Projects\uno\Ciao.cc|3|QPushButton: No such file or directory|
    C:\Projects\uno\Ciao.cc|4|QWidget: No such file or directory|
    C:\Projects\uno\Ciao.cc|7|error: expected class-name before '{' token|
    C:\Projects\uno\Ciao.cc|9|error: expected `)' before '*' token|
    C:\Projects\uno\Ciao.cc|11|error: expected `)' before '*' token|
    C:\Projects\uno\Ciao.cc|11|error: expected `,' or `;' before '*' token|
    C:\Projects\uno\Ciao.cc||In function `int main(int, char**)':|
    C:\Projects\uno\Ciao.cc|24|error: `QApplication' undeclared (first use this function)|
    C:\Projects\uno\Ciao.cc|24|error: (Each undeclared identifier is reported only once for each function it appears in.)|
    C:\Projects\uno\Ciao.cc|24|error: expected `;' before "app"|
    C:\Projects\uno\Ciao.cc|26|error: 'class MyWidget' has no member named 'show'|
    C:\Projects\uno\Ciao.cc|27|error: `app' undeclared (first use this function)|
    ||=== Build finished: 13 errors, 0 warnings ===|
    Last edited by jpn; 5th July 2008 at 19:26. Reason: missing [code] tags

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [QT] I can't debug my applications

    How did you install QT libraries?
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Jul 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [QT] I can't debug my applications

    I installed QT 4.4 with MinGW and followed the go-ahead-buttons during the installation. How do I should? Is there something to set up and/or compile?

  4. #4
    Join Date
    Jul 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [QT] I can't debug my applications

    I've tried with this comand:

    C:\Qt\4.4.0\src>qtvars.bat compile_debug

    and now this is the situation:

    1. I click on Tools > qmake
    2. I click on Bulid > Build
    3. I click on Build > Run

    and after the 3rd step I get an allert:

    "It seems that this project has not been built yet. Do you want to build it now?"

    4. Obviously I click yes but it just build it without running. I've checked also on process list.
    If I click no it open the dos prompt and behave like if the program was launched, but it's not.

    But actually after 3rd step it's already built and if I go on the folder and I click it, it runs.

    Pretty strange, isn't it? It's pretty annoying too.. who knows how to fix it?

Similar Threads

  1. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  2. Replies: 2
    Last Post: 8th November 2007, 20:15
  3. What is debug mode for without MSVC?
    By firegun9 in forum Newbie
    Replies: 1
    Last Post: 5th September 2007, 17:21
  4. Qt4 open src mingw from a PC to another
    By nvictor in forum Installation and Deployment
    Replies: 11
    Last Post: 1st May 2007, 17:41
  5. Adding custom defines when on debug build
    By chus in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2007, 11:38

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.