Configure Qt development on Windows + Mac + linux: Difference between revisions

From Bitpost wiki
(Created page with "Start with Qt Creator on Mac or linux for the smoothest experience... To set up for linux development.. * install Qt and Qt Creator using your favorite distro's package manager ...")
 
No edit summary
Line 12: Line 12:
* run Qt Creator and compile and run
* run Qt Creator and compile and run


To set up for Windows development (PAIN in the ASS, only do this once central repo and another platform are up and working)..
To set up for Windows development with Visual Studio (PAIN in the ASS, only do this once central repo and another platform are up and working)..
* install Visual Studio + Add-in + egit (MUCH better than msysgit)
* install Visual Studio + Add-in + eclipse CDT and egit (MUCH better than msysgit)
* start eclipse and select File->Import, select Projects from Git, hit Clone, set up remote repo and hit next, CHANGE crappy default location to C:\Michael's Data\development\thedigitalage\hangthedj.
* start eclipse and select File->Import, select Projects from Git, hit Clone, set up remote repo and hit next, CHANGE crappy default location to C:\Michael's Data\development\thedigitalage\hangthedj.
* repeat for Reusable
* repeat for Reusable
* now we have to build Qt libraries since for some reason they haven't released a 2010 build yet, wtf....
* now we have to build Qt libraries since for some reason they haven't released a 2010 build yet (wtf!)
* start Visual Studio and select Qt->Import .pro file
* Get a copy of the source for your cross-platform Qt app, ideally already tested and working on another platform, on your Windows box.  Use git, whee!
* you should now have a *.sln file you can work with
* Install Visual Studio 2010.
 
* Install <a href="http://support.microsoft.com/kb/2280741">this patch</a> to fix support for 64-bit apps.
Windows box: Qt open-source Windows libraries + Visual Studio 2010 + Visual Studio 2010 Qt Add-in + eclipse + egit (for git functionality)
* Install the DirectX SDK
* Download and unzip the <a href="http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.2.zip">Qt opensource code</a> to [c:\\Qt\4.7.2] (or whatever version you get).
* Open a "Visual Studio command prompt" and compile Qt as follows.  Note that for phonon, <strong>you MUST compile Qt as shared not static.</strong>  You might be able to switch back to static after you build the phonon dll's, but I didn't try that.
<pre>nmake confclean
nmake clean
echo yes &#62yes.txt
configure -debug-and-release -opensource -shared -nomake demos -nomake examples -no-qt3support -qt-sql-sqlite -phonon -phonon-backend -no-webkit -no-script -platform win32-msvc2010 &#60yes.txt
nmake</pre>
* Wait a while for that to finish... :&#62  Definitely use the above settings to skip the demos and examples if you want to save time.
* Because we built shared, you should now have Qt dll's (including phonon) in [c:\\Qt\4.7.2\bin].  Copy the debug versions of dll's (*d4.dll) into the directory with your debug exe, and repeat with (*4.dll) for release.
* Install the <a href="http://qt.nokia.com/downloads/visual-studio-add-in">Qt Visual Studio Add-In</a> (this version works with Visual Studio 2010)
* Open Visual Studio.  You should see a nice new Qt menu item sandwiched between View and Project.  Select [Qt->Qt Options], hit Add, and browse to the source directory.  With any luck Qt will enable the OK button for ya...
* Select [Qt->Open Qt Project (.pro)], browse to your project, and load it up.  Visual Studio will spend a few minutes getting comfortable with all the Qt headers, and then you should have a *.sln file you can work with - you should be able to compile and debug just like you do with all your skanky (j/k) Windoze code.  Yay!

Revision as of 22:52, 28 August 2011

Start with Qt Creator on Mac or linux for the smoothest experience...

To set up for linux development..

  • install Qt and Qt Creator using your favorite distro's package manager
  • dump in some sample code and get it compiling and running
  • install git using your package manager
  • set up a central git repo and push your sample code to it

To set up for Mac development...

  • download the Mac Qt environment, including Qt Creator
  • install git and pull down the code
  • run Qt Creator and compile and run

To set up for Windows development with Visual Studio (PAIN in the ASS, only do this once central repo and another platform are up and working)..

  • install Visual Studio + Add-in + eclipse CDT and egit (MUCH better than msysgit)
  • start eclipse and select File->Import, select Projects from Git, hit Clone, set up remote repo and hit next, CHANGE crappy default location to C:\Michael's Data\development\thedigitalage\hangthedj.
  • repeat for Reusable
  • now we have to build Qt libraries since for some reason they haven't released a 2010 build yet (wtf!)
  • Get a copy of the source for your cross-platform Qt app, ideally already tested and working on another platform, on your Windows box. Use git, whee!
  • Install Visual Studio 2010.
  • Install <a href="http://support.microsoft.com/kb/2280741">this patch</a> to fix support for 64-bit apps.
  • Install the DirectX SDK
  • Download and unzip the <a href="http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.2.zip">Qt opensource code</a> to [c:\\Qt\4.7.2] (or whatever version you get).
  • Open a "Visual Studio command prompt" and compile Qt as follows. Note that for phonon, you MUST compile Qt as shared not static. You might be able to switch back to static after you build the phonon dll's, but I didn't try that.
nmake confclean
nmake clean
echo yes &#62yes.txt
configure -debug-and-release -opensource -shared -nomake demos -nomake examples -no-qt3support -qt-sql-sqlite -phonon -phonon-backend -no-webkit -no-script -platform win32-msvc2010 &#60yes.txt
nmake
  • Wait a while for that to finish... :&#62 Definitely use the above settings to skip the demos and examples if you want to save time.
  • Because we built shared, you should now have Qt dll's (including phonon) in [c:\\Qt\4.7.2\bin]. Copy the debug versions of dll's (*d4.dll) into the directory with your debug exe, and repeat with (*4.dll) for release.
  • Install the <a href="http://qt.nokia.com/downloads/visual-studio-add-in">Qt Visual Studio Add-In</a> (this version works with Visual Studio 2010)
  • Open Visual Studio. You should see a nice new Qt menu item sandwiched between View and Project. Select [Qt->Qt Options], hit Add, and browse to the source directory. With any luck Qt will enable the OK button for ya...
  • Select [Qt->Open Qt Project (.pro)], browse to your project, and load it up. Visual Studio will spend a few minutes getting comfortable with all the Qt headers, and then you should have a *.sln file you can work with - you should be able to compile and debug just like you do with all your skanky (j/k) Windoze code. Yay!