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. Unable to get a hello world qt app

Unable to get a hello world qt app

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.5k 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.
  • T3STYT Offline
    T3STYT Offline
    T3STY
    wrote on last edited by
    #1

    Hello all!
    I'm trying to get into Qt development, but so far I have been unable to achieve any good result.

    I have installed QtCreator with the Qt 5.1.0 toolkit and I have the MSVC2012 (x86 and x64) and mingw compiler on my Windows 7 system.
    I have started with creating a new Qt GUI application project and ran through the wizard. And then I have compiled the app. Compiling went fine so I ran the app, but since I press the Run button I get nothing on the screen. In Windows's Task Manager, at the processes tab, I can see there is the executable running (in my case hw.exe) but there is no window popping out on run.

    Also, I have tried following some tutorials from the wiki and from the web; they all start with an empty project and to the authors the compiling goes fine, but for me I'm getting warnings and errors like:
    @[W] LNK4042: C:\Users\T3STY\Documents\Qt Projects\build-helloworld-Desktop_Qt_5_1_0_MSVC2012_OpenGL_64bit-Release\release\main.obj:-1: warning: LNK4042: object specified more than once; extras ignored
    [E] LNK2019: qtmain.lib(qtmain_win.obj):-1: error: LNK2019: unresolved external symbol main referenced in function WinMain
    [E] LNK1120: release\helloworld.exe:-1: error: LNK1120: 1 unresolved externals@

    Could someone please help me getting my first Qt GUI app compiled right?

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      Qnoobish
      wrote on last edited by
      #2

      I would say, check your .pro configuration if it is a QtWidget based app then you will need a line similar to this:

      QT += core gui

      after you make sure everything is correct in your .pro run Qmake and try to build and run your app.

      You didn't post your example code but hopefully it is OK if you followed some working tutorial.

      In short, software is eating the world.

      1 Reply Last reply
      0
      • T3STYT Offline
        T3STYT Offline
        T3STY
        wrote on last edited by
        #3

        I actually worked with the base code that the QtCreator wizard creates, that's why I didn't post any code. I guess, the code the wizard creates is not complete for a test? I read on many tutorials that it should be...

        Anyway, the .pro file already contains that line. But maybe I'm doing something wrong somewhere else. Would you be so kind to post a working project?

        1 Reply Last reply
        0
        • T3STYT Offline
          T3STYT Offline
          T3STY
          wrote on last edited by
          #4

          Updating:
          I've been able to make a working GUI application. When I posted the code I was using was incomplete, the Window wasn't created at all.

          Thank you for help!

          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