<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to msvc</title><link>https://sourceforge.net/p/unetbootin/wiki/msvc/</link><description>Recent changes to msvc</description><atom:link href="https://sourceforge.net/p/unetbootin/wiki/msvc/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 24 Jun 2014 15:13:03 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/unetbootin/wiki/msvc/feed" rel="self" type="application/rss+xml"/><item><title>msvc modified by &lt;REDACTED&gt;</title><link>https://sourceforge.net/p/unetbootin/wiki/msvc/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="compiling-qt-projects-with-microsoft-visual-c"&gt;Compiling Qt Projects with Microsoft Visual C++&lt;/h1&gt;
&lt;h2 id="setting-up-the-build-environment"&gt;Setting up the build environment&lt;/h2&gt;
&lt;h3 id="visual-studio-2005"&gt;Visual Studio 2005&lt;/h3&gt;
&lt;p&gt;If you wish to dynamically link Qt into your application (that is, it will require external DLLs to be present upon runtime): &lt;br /&gt;
Download &lt;a href="http://launchpad.net/unetbootin/trunk/trunk/+download/qt4.5.1-dynamic-msvc2005-debug.7z" rel="nofollow"&gt;http://launchpad.net/unetbootin/trunk/trunk/+download/qt4.5.1-dynamic-msvc2005-debug.7z&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If instead you wish to statically link Qt into your application (that is, no external libraries will be required upon runtime): &lt;br /&gt;
Download &lt;a href="http://gkovacs.xvm.mit.edu/qt4.5.1-static-msvc2005-release-minimal.7z" rel="nofollow"&gt;http://gkovacs.xvm.mit.edu/qt4.5.1-static-msvc2005-release-minimal.7z&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now extract your downloaded file, using &lt;a class="" href="http://7-zip.org/" rel="nofollow"&gt;7-zip&lt;/a&gt;, to C:\Qt; a directory C:\Qt\qt4-msvc2005 should be created, with various subdirectories such as bin, include, and lib. &lt;/p&gt;
&lt;p&gt;Now create a shortcut (hereby referred to as "Qt Command Prompt") that runs: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;C:\Qt\qt4-msvc2005/qtenv.bat&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="visual-studio-2008"&gt;Visual Studio 2008&lt;/h3&gt;
&lt;p&gt;If you wish to dynamically link Qt into your application (that is, it will require external DLLs to be present upon runtime): &lt;br /&gt;
Download &lt;a href="http://gkovacs.xvm.mit.edu/qt4.5.1-dynamic-msvc2008-debug.7z" rel="nofollow"&gt;http://gkovacs.xvm.mit.edu/qt4.5.1-dynamic-msvc2008-debug.7z&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now extract your downloaded file, using &lt;a class="" href="http://7-zip.org/" rel="nofollow"&gt;7-zip&lt;/a&gt;, to C:\Qt; a directory C:\Qt\qt4-msvc2008 should be created, with various subdirectories such as bin, include, and lib. &lt;/p&gt;
&lt;p&gt;Now create a shortcut (hereby referred to as "Qt Command Prompt") that runs: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;C:\Qt\qt4-msvc2005/qtenv.bat&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="compiling-the-software"&gt;Compiling the software&lt;/h2&gt;
&lt;p&gt;The Visual C++ compiler and linker can be invoked either via the command line, using the nmake utility on a Makefile, or within the Visual Studio interface itself, using a project and a solution file. Since Qt projects use their own make system, &lt;a class="" href="http://doc.trolltech.com/4.5/qmake-manual.html" rel="nofollow"&gt;qmake&lt;/a&gt;, which uses a .pro file (see &lt;a class="" href="http://doc.trolltech.com/4.5/qmake-variable-reference.html" rel="nofollow"&gt;documentation&lt;/a&gt; ), you will need to generate the appropriate makefiles or project/solution files before building. Note that you will have to repeat this cycle whenever you modify the .pro file. &lt;/p&gt;
&lt;h3 id="generating-and-using-makefiles"&gt;Generating and using Makefiles&lt;/h3&gt;
&lt;p&gt;Open the Qt Command Prompt, cd to the directory containing the .pro file, and run: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;qmake&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A Makefile should be generated. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Building the Project&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now you can build the project using: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;nmake&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Running the Project&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can run the project by running the generated .exe file in the "release" or "debug" subdirectory. &lt;/p&gt;
&lt;p&gt;If this is a console-based interface and you aren't seeing any output, edit the .pro file and add in: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;CONFIG&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;console&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then rebuild the project and run again. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Debug and Release Modes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you wish to switch between debug or release mode, edit the .pro file, and change (or add) the line: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;CONFIG&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;debug&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;CONFIG&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;release&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Cleaning the build directory&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To clean out the build directory for a rebuild, run: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;nmake&lt;/span&gt; &lt;span class="n"&gt;clean&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="generating-and-using-project-and-solution-files"&gt;Generating and using Project and Solution Files&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Using qmake:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Open the Qt Command Prompt, cd to the directory containing the .pro file, and run: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;qmake&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tp&lt;/span&gt; &lt;span class="n"&gt;vc&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A .vcproj file should be generated. &lt;/p&gt;
&lt;p&gt;Now you can open the .vcproj file in Visual Studio and do the standard Build-&amp;gt;Build Solution procedure to generate a solution file and build the project. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Qt Visual Studio Add-in:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Alternatively, if you have the Standard or Professional edition of Visual Studio, you can use the &lt;a class="" href="http://doc.trolltech.com/vs-integration-1.4/index.html" rel="nofollow"&gt;Qt Visual Studio Add-in&lt;/a&gt; to generate a project file; to do so: &lt;/p&gt;
&lt;p&gt;Download and install &lt;a href="http://www.qtsoftware.com/downloads/visual-studio-add-in" rel="nofollow"&gt;http://www.qtsoftware.com/downloads/visual-studio-add-in&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Open Visual Studio; there should now be a "Qt" menu on the top. Go to Qt-&amp;gt;Qt Options, click "add", and select the path "C:\Qt\qt4-msvc2005" &lt;/p&gt;
&lt;p&gt;Now go to Qt-&amp;gt;Open Qt Project File, select the .pro file, and a .vcproj file should be generated. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Building the Project&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now you can open the .vcproj file in Visual Studio and do the standard Build-&amp;gt;Build Solution procedure to generate a solution file and build the project. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Running the Project&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can run the project by going to "Debug-&amp;gt;Start Without Debugging" &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Debug and Release Modes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you wish to switch between debug or release mode, go to Build-&amp;gt;Configuration Manager, and select either "Debug" or "Release" as the Active solution configuration. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cleaning the build directory&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To clean the build directory, go to "Build-&amp;gt;Clean Solution" &lt;/p&gt;
&lt;h2 id="see-also"&gt;See Also&lt;/h2&gt;
&lt;p&gt;&lt;a class="" href="http://qtnode.net/wiki/Qt4_with_Visual_Studio" rel="nofollow"&gt;Qt4 with Visual Studio&lt;/a&gt; &lt;br /&gt;
&lt;a class="" href="http://qtnode.net/wiki/Qt4_with_Visual_Studio_and_static_C_runtime" rel="nofollow"&gt;Qt4 With Visual Studio and static C runtime&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><pubDate>Tue, 24 Jun 2014 15:13:03 -0000</pubDate><guid>https://sourceforge.netd4137608995b9f829b041646c963a3b37c65b797</guid></item></channel></rss>