Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building Qt5 projects via VS2012 Visual C++ project
QtWS25 Last Chance

Building Qt5 projects via VS2012 Visual C++ project

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 2 Posters 2.1k Views
  • 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.
  • M Offline
    M Offline
    mwpowellhtx
    wrote on last edited by
    #1

    First of all, is it even possible? It seems like with VS-add-ins and what not, Qt wants to have its fingers throughout the build process.

    If I just wanted to identify Qt (i.e. includes, libs, etc) as part of a Visual C++ project, is that all we need to do: i.e. identify those directories and such?

    If we need to use the add-in, or even work through QtCreator, we will, but I'd like to run through Visual Studio since that is our preferred IDE.

    Thanks in advance...

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Well for starters, you need a way to launch the "moc compiler":http://qt-project.org/doc/qt-5/moc.html from a VS2012 project.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mwpowellhtx
        wrote on last edited by
        #3

        There is that. Which is all orchestrated via the Qt5 add-in?

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          Haven't tried the Qt5 add-in myself (after 20+ years with Visual Studio, for me it feels refreshing using QtCreator :-), but If it succeeds in building a Qt app then it has to run the moc at some point...

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mwpowellhtx
            wrote on last edited by
            #5

            Okay, well I don't disagree. If there's an intermediate code-generation step, no problem. It seems that there's got to be a way to either: 1) run a pre-build step, or 2) that the Qt5 add-in allows working with QtCreator "PRO" and "PRI" files. Which I see it does; not having done this through Visual Studio before, is it that the add-in wants to work exclusively with PRO and/or PRI files as opposed to native VS2012 project files? It might make sense considering there is potential for generated files. Mainly I just want to know what I'm working with is all... Thank ye...

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mwpowellhtx
              wrote on last edited by
              #6

              Or perhaps I am not seeing this correctly. It seems the add-in wants already-existing PRO files to work with. Which means that QtCreator is necessarily inescapable. Ugh. That's important to keep in mind as well for our Continuous Integration steps.

              1 Reply Last reply
              0
              • hskoglundH Offline
                hskoglundH Offline
                hskoglund
                wrote on last edited by
                #7

                It's not that bad :-) Qt I think does a good job of trying to integrate with tools like Visual Studio. For example, once you have successfully built your app inside QtCreator, you can continue edit it with Visual Studio (or Notepad..) then to enter another build cycle:

                1. Start a Developer Command Prompt for VS2012
                2. CD to the build directory of your app (where there's a makefile)
                3. Type nmake

                and you should have a new .exe.

                EDIT: BTW, if you want to test/run the new .exe. you can invoke the qtenv2.bat (found in Qt's installation dir), to establish a path to Qt's DLLs in your Developer Command Prompt.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mwpowellhtx
                  wrote on last edited by
                  #8

                  I'm sure it's not. The actual process does not intimidate me. Nor does the fact that Qt involves its own dialect of C++; so suddenly we're locked into the Qt motif, when maybe all we're interested in is basically fancier language standards.

                  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