Results 1 to 4 of 4

Thread: Build a Qt project using MSBuild

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Build a Qt project using MSBuild

    Good morning forum,
    I need to build a Qt project using only MSBuid (without installing Visual Studio). Can you help me?
    Is possible to create a Qt Creator kit based on MSBuild as build tool? I searched on internet without any result.
    Thank to all.
    Franco
    Franco Amato

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Build a Qt project using MSBuild

    MSBuild uses the vcxproj files as input to control the build process. These are XML files containing a series of build steps and commands. These invoke the compiler, linker, and various other tools required to build a project, much in the same way a Qt Creator kit does. You still need a compiler, linker, and all of the other tools installed - MSBuild does not include them. So a Qt Creator kit and MSBuild are two different ways of doing the same thing and are compatible only at the level of the tools each one uses to build a project.

    You've probably found the MSBuild documentation from Microsoft. It has examples of how to build a vcxproj file by hand. Normally you would use Visual Studio for this, but if you have a project file, you can run MSBuild from the command line.

    Is there a reason you must use MSBuild standalone and not with a Community Edition of Visual Studio?

    You might also consider cmake. From what I understand, Qt6 will be using that for builds.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Build a Qt project using MSBuild

    Thank you very much d_stranz.
    We can not use VS2019 community edition because it's free only for companies having up to 5 employees and the company has 10.
    You told "You still need a compiler, linker, and all of the other tools installed" where can I get them? We also tried using mingw but our work depends on some sdk build for VS and not for mingw, so it simply does not work.
    I though that msbuid contains all the necessary tools to create the executables.
    Thanx again
    Franco Amato

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Build a Qt project using MSBuild

    I though that msbuild contains all the necessary tools to create the executables.
    No, unfortunately, MSBuild is like QtCreator, make, cmake, ant, or any other build system - it is a controller that helps manage all of the project dependencies and build the parts using the right tools in the right order. It doesn't come with the toolchain - the compilers, linkers, etc. That's what makes them so flexible - you can supply your own. Some of the MSBuild examples actually use building a Java app as the project, nothing involving C++ at all.

    I don't think you have much choice except to buy the most basic version of Visual Studio. I don't know if Microsoft sells just the tools without the IDE.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. The following user says thank you to d_stranz for this useful post:

    franco.amato (27th June 2020)

Similar Threads

  1. Qt 4.6.2 build a project
    By Robix in forum Newbie
    Replies: 3
    Last Post: 19th April 2016, 14:30
  2. Can't build a sample project
    By gpuckett in forum Newbie
    Replies: 3
    Last Post: 5th May 2014, 01:17
  3. Nonstop when build project
    By Wong in forum Qt Programming
    Replies: 2
    Last Post: 13th January 2011, 13:39
  4. Cant build Qt project
    By ChrisBuchholz in forum Installation and Deployment
    Replies: 7
    Last Post: 21st July 2010, 00:05
  5. i want build My project use VLC library on QT
    By nhs_0702 in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2010, 07:41

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.