Results 1 to 12 of 12

Thread: How to compile Qt with Microsoft Visual Studio

  1. #1
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default How to compile Qt with Microsoft Visual Studio

    I created a Qt programme, I can compile it without problem manuelly with Visual Studio (using Add-In) but when I try to compile it with coding I have a problem. The problem is
    Qt Code:
    1. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\output\Deneme\Qt\projectQt.vcxproj]
    2. Done Building Project "C:\output\Deneme\Qt\projectQt.vcxproj" (default targets) -- FAILED.
    3.  
    4. Build FAILED.
    5.  
    6. "C:\output\Deneme\Qt\projectQt.vcxproj" (default target) (1) ->
    7. (CustomBuild target) ->
    8. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\output\Deneme\Qt\projectQt.vcxproj]
    9.  
    10. 0 Warning(s)
    11. 1 Error(s)
    To copy to clipboard, switch view to plain text mode 
    How can I solve the problem, please help me…

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to compile Qt with Microsoft Visual Studio

    What do you mean by coding?

  3. #3
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to compile Qt with Microsoft Visual Studio

    compile the software with using other c++ project (inside).

  4. #4
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to compile Qt with Microsoft Visual Studio

    anyone can help me?

  5. #5
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,391
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to compile Qt with Microsoft Visual Studio

    What do you mean by "compile the software with using other c++ project (inside)" ? Linking to external library ?

  6. #6
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to compile Qt with Microsoft Visual Studio

    I am tring to compile my Qt program with another C++ program.

  7. #7
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,391
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to compile Qt with Microsoft Visual Studio

    Sorry you have to be more precise. Where is this another C++ program ? Inside your project folder ? More details needed.
    This sentence can be understood also as "I am trying to compile my Qt program with my own compiler".

  8. #8
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to compile Qt with Microsoft Visual Studio

    I have 2 project one of them is Qt project and the other one is C++ project. Qt project can compile and run without any problem manuelly using Visual Studio Add-In. But I want to compile and run the Qt project with the other C++ project.
    for example, using this code inside the C++ project.

    system(command.c_str());

  9. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,719
    Thanks
    259
    Thanked 760 Times in 750 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: How to compile Qt with Microsoft Visual Studio

    So, if I understand what you are saying, you are not trying to compile your Qt program using a plain C++ program, you are trying to run it from the C++ program, is that right?

    You have "projectQt.exe" somewhere, and you want your C++ program to do something like this:

    Qt Code:
    1. static std::string runQtProgramCommand = "C:\\output\\Deneme\\Qt\\projectQt.exe";
    2.  
    3. int main( int argc, char * * argv )
    4. {
    5. return system( runQtProgramCommand.c_str() );
    6. }
    To copy to clipboard, switch view to plain text mode 

    In order for this to work, you need to have the environment for the Qt program configured correctly:

    1 - All of the Qt DLLs required by projectQt.exe have to be in the same directory as projectQt.exe (or have to be located in your $PATH environment variable)
    2 - If you are using Qt 5.x, then you have to have qwindows.dll in a subdirectory .\platforms under the directory where projectQt.exe lives. See this thread.
    3 - Anything else that projectQt.exe depends on also has to be in the projectQt.exe directory or on the $PATH.

  10. #10
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to compile Qt with Microsoft Visual Studio

    Thanks for codes for running. (" system( runQtProgramCommand.c_str() ); ") I found it before you said but I cant find compiling codes. How can I compile my Qt program? Anyone have any idea?

  11. #11
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to compile Qt with Microsoft Visual Studio

    You will need to modify some sort of pre build steps in the Visual Studio.. or add the compiling steps for Qt app as dependencies.

    I am not much aware of the Visual studio project files... so if you know, add some pre build step for the Qt app

  12. #12
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to compile Qt with Microsoft Visual Studio

    I dont know it so I need helps....

Similar Threads

  1. Replies: 7
    Last Post: 18th April 2013, 23:39
  2. qmake and Microsoft Visual Studio project filters
    By erik in forum Installation and Deployment
    Replies: 1
    Last Post: 11th January 2013, 07:13
  3. HowTo get work Microsoft VS 2010 and Qt Visual Studio Add-in?
    By NewLegend in forum Installation and Deployment
    Replies: 15
    Last Post: 17th October 2010, 19:15
  4. Replies: 1
    Last Post: 20th September 2010, 17:49
  5. Replies: 3
    Last Post: 14th December 2009, 09:38

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.