Results 1 to 4 of 4

Thread: [HELP] window won't show after build

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Question [HELP] window won't show after build

    Hello!

    I'm completely new to Qt and have been checking it out for couple days for now. I've tried to run this simple "http://zetcode.com/tutorials/qt4tutorial/breakoutgame/breakout" game example which I found. First I got this error when running the code ( d:\Qt\2010.02.1\qt\lib/libqtmaind.a:-1: error: In function `WinMain@16': ) and it didn't compile at all. Adding empty main() function solved this. But now the code does build without errors - but only problem is that no window what so ever pops up or signals that the program even was launched after building. Any help ?

    I have some background from basic-like languages and I'm trying to get in touch with Qt and figure out what everything I need to get simple image drawn from a file to specific coordinates, which could be changed- for example- via pressing key. This BreakOut seems to have all but I'm having this problem when trying to run it.

    I was able to get other pieces of code running without any similar problems, so I'll assume it's in the code.

    Everything needed is included in the attachment.

    Thanks and sorry for the bad grammar. Hope you understood my problem.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [HELP] window won't show after build

    Create your main in a separate file

    To Have an app running and entering the Qt event loop:
    Qt Code:
    1. int main(int argc, char* argv[])
    2. {
    3. QApplication app(argc, argv);
    4. YourClass inst;
    5. inst.show();
    6. return app.exec();
    7. }
    To copy to clipboard, switch view to plain text mode 

    See the doc and Qt demo for the basics.
    Last edited by toutarrive; 9th March 2010 at 17:18.

  3. #3
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: [HELP] window won't show after build

    Did like you said and added main.cpp to the project with the code you described, but now the window is showing alright, but it's totally blank..

    starting to look like it's little bit too big first Qt project for me to get this Breakout example working.. But thanks anyways toutarrive.

  4. #4
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [HELP] window won't show after build

    Keep going...

Similar Threads

  1. show build date in about box
    By glocker50 in forum Qt Programming
    Replies: 12
    Last Post: 3rd May 2015, 23:14
  2. Show advertising window
    By jano_alex_es in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 13:03
  3. Show parent window
    By Qt Coder in forum Qt Programming
    Replies: 7
    Last Post: 8th June 2009, 10:19
  4. How to show a window widget...
    By agent007se in forum Newbie
    Replies: 3
    Last Post: 20th July 2006, 11:42
  5. Not show the progress bars under another window
    By SkripT in forum Qt Programming
    Replies: 6
    Last Post: 13th March 2006, 18:22

Tags for this Thread

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.