Menu

Developing Frogface on Windows

2007-02-03
2013-04-26
  • Declan McGrath

    Declan McGrath - 2007-02-03

    -- Developing on Frogface on a Windows 2000 Machine --

    The following instructions are partially based on a very useful article at http://storybridge.org/index.php/QtMing which contains more detail on some topics discussed here. These instructions are intended to get you from having a vanilla Windows box to having Frogface installed and building. This article was written with a Windows 2000 machine in mind but there should be no major differences for other versions.

    * Get QT and MinGW installed on your system:
    1.) In your web browser, go to ftp://ftp.trolltech.com/qt/source/ and download the appropriate version of the QT/Mingw combo. You will want to download one of the '.exe' files. In this example, I have downloaded qt-win-opensource-4.2.2-mingw.exe
    2.) Install QT and MinGW from the file you have just downloaded. Upon running the installation wizard
      - Check the option to download and install MinGW
      - Check the option to download and install the MinGW source code (for the version of the installer that I was running this option was placed at the bottom of the 'Select a download mirror page' of the wizard, so keep eagle-eyed!)

    * Get the tar and gzip programs installed on your system:
    1.) In your web browser, go to http://gnuwin32.sourceforge.net/packages/tar.htm and download tar. You will want to download the setup file (NOT the zip file) which has the desciption 'Binaries'. In this example, I have downloaded from http://gnuwin32.sourceforge.net/downlinks/tar-bin.php
    2.) In your web browser, go to http://gnuwin32.sourceforge.net/packages/gzip.htm and download gzip. You will want to download the setup file (ie. Complete package, except sources) NOT the zip file. In this example, I have downloaded from http://gnuwin32.sourceforge.net/downlinks/gzip.php
    3.) Open both these files and accept the defaults for installation

    * Get the GNU Debugger installed on your system:
    In your web browser, go to http://www.mingw.org/download.shtml and download the lastest '.exe' for GDB. This page is pretty busy and a bit confusing to find the link you want. You need to scroll down to the 'File List' section of the page and then look for the GDB exe that's under the Current->gdb row of the File is example, I used the link http://prdownloads.sf.net/mingw/gdb-5.2.1-1.exe?download
    Once the file in downloaded, install it and accept the defaults

    * Get the actual QT source code on your system and compile it
    1.) In your web browser, go to ftp://ftp.trolltech.com/qt/source/ and download the appropriate version of the QT source code. You will want to download one of the '.zip' files which has a name like qt-win-opensource-src-<QT VERSION>.zip. In this example, I have downloaded qt-win-opensource-src-4.2.2.zip
    2.) Unzip your downloaded file to C:\Qt
    Note: if you use winzip to do this it will create a sub-folder  called 'qt-win-opensource-src-4.2.2', which isn't quite what we want. Rename this folder to just the version number, in this case simply '4.2.2'. For example, you can rename the file by opening a command prompt in Windows and typing (you might as well do this through the command line as we'll be doing more stuff from the command line in the next step)
        cd C:\Qt
            rename qt-win-opensource-src-4.2.2 4.2.2
    3.) Now we're going to actually compile QT. Run each of the following commands line by line in a windows command prompt, subsituting '4.2.2' for your QT version where appropriate
       set QTDIR=C:\Qt\4.2.2
       set PATH=%QTDIR%\bin;C:\MinGW\bin;%PATH%
       set QMAKESPEC=win32-g++
       configure -qt-gif -qt-libpng -qt-sql-sqlite -dont-process
       cd src
       qmake -makefile src.pro
       mingw32-make
       cd ..\tools
       qmake -makefile tools.pro
       mingw32-make

    * Setup Environment variables for QT
    1.) Right click "My Computer" on the desktop, and click "System Properties". From the dialog that opens, select the "Advanced" tab, and click the "Environment Variables" button
    2.) Add Qt to the system path as follows
            - In the lower "System Variables" frame select "path" and click edit
            - Add to the end of the path in the text box ";C:\Qt\4.2.2\bin"
    3.) Create two new Qt environment variables as follows
        - In the lower "System Variables" frame click the "New..." button
        - Enter: varable name QTDIR, variable value "C:\Qt\4.1.0\bin"
        - Click OK
        - In the lower "System Variables" frame click the "New..." button
        - Enter: varable name QMAKESPEC, variable value win32-g++
        - Click OK

    * Fix CompletelyEvilMingw issue
    1.) Open the file C:\Qt\4.2.2\mkspecs\features\win32\windows.prf (or subsitute 4.2.2 for your QT version number) in notepad
    2.) Comment out the buggy line
        win32-g++:DEFINES += QT_NEEDS_QMAIN
        by sticking a hash sign in front of it, thus changing it to
        # win32-g++:DEFINES += QT_NEEDS_QMAIN

    * Download TortiseSvn to get access to the Frogface codebase on SourceForge
    1.) In your web browser, go to http://tortoisesvn.net/downloads
    Download the appropriate '.msi' installer for your machine. I used the TortoiseSVN-1.4.2.8580-win32-svn-1.4.3.msi file for this example, which is available directly at the link http://prdownloads.sourceforge.net/tortoisesvn/TortoiseSVN-1.4.2.8580-win32-svn-1.4.3.msi?download
    2.) Run the installer and accept the defaults.

    * Get the Frogface codebase from the subversion repository
    1.) Open windows explorer and create a directory to which you would like to download the Frogface codebase. For example, c:\Projects\frogface
    2.) Go into this directory and right-click on an empty area in order to bring up the right-click context menu. Because you have already installed tortoisesvn there should be an option in this menu called "SVN Checkout..." Select this option and you will be presented with a dialog box. In this dialog box accept the defaults except for the following fields
        - Url of repository: https://frogface.svn.sourceforge.net/svnroot/frogface
        - checkout directory: the folder you want to check out to (eg. c:\Projects\frogface)
    Click 'OK' and tortoisesvn should pull down the entire Frogface codebase into the specified folder. The current version of frogface is under the folder 'trunk'. Hey presto! You've just checked out Frogface!!!

    * Build Frogface
    Note: On Windows, the actual builds themselves are carried out with the 'mingw32-make' command (as opposed to the 'qmake' command on *NIX)
    1.) Navigate to the directory containing frogface/trunk via windows command prompt. Run the command 'qmake -o Makefile frogface.pro'
    2.) Navigate to the directory containing frogface/trunk/src via windows command prompt. Run the command 'qmake -o Makefile src.pro'
    Note: If you get and error saying "WARNING: Unable to expand ~ in ~\bin" then there is a bug in the src.pro file in that directory. To fix this bug you need to open the file and change the the line
        target.path = ~/bin
    to
        target.path = ./bin
    then rerun command 'qmake -o Makefile src.pro'. This bug should not occur in the latest version of frogface in the repository. If you encounter it post on the mailing list to let other developers know.
    Note 2: If you get funny characters at the end of each line when you open up src.pro then your text editor is probably messing up the UNIX newline characters. You might want install gvim or other editor that is capable of reading these - gvim is available at http://www.vim.org/download.php#pc (install the Windows 'Self-installing executable' which is gvim70.exe)
    3.) Navigate to the directory containing frogface/trunk via windows command prompt. Run the command 'mingw32-make'
    4.) Sit back and watch that beautiful code compile - even better than having a Matrix screensaver on your monitor
    5.) The executable for Frogface is called frogface.exe and is located in the frogface/trunk/src/bin directory (note: for Linux users the exectutable is just called frogface and is located in the frogface/trunk/bin directory)

    Phew! That's enough typing from me for one day. It should do the trick. Hopefully that will sort out any Windows based hassles! If there are is any feedback on this guide please post below.

    Cheers,
    Declan

     
    • Eternal Zombie

      Eternal Zombie - 2007-02-19

      Hi All,

      If you have very reliable broadband internet at home then above help guide by Dec is just what you need. However if you dont have good reliable internet and want to download packages on your own and then install MinGW and QT then below are the steps for this.

      I would like to post my experience while building Frogface. I downloaded MinGW's packages seperately and then installed them.

      Since I use Windows most of the time as my development medium, I am used to install some setup.exe which does all the installation for me. So doing on my own was initially a bit fearsome. But dont worry it is not that fearsome. You can follow my approach that, have Frogface build first then sit back and think as to how you did and what were important steps.

      So here are the things which you should do [Just a compilation of relavant points from Dec's and Storybridge's folks guilde @ http://storybridge.org/index.php/QtMing ]

      1. Download GNU tar and GNU GZip programme from

          http://gnuwin32.sourceforge.net/downlinks/tar-bin.php
          http://gnuwin32.sourceforge.net/downlinks/gzip.php

      Save them on your desktop and the run the downloaded exe files. Just accept all the default values. By default tar and gunzip would be installed in C:\Program Files\GnuWin32\bin.

      2.     Right click "My Computer" on the desktop, and click "System Properties"
          From the dialog that opens, select the "Advanced" tab, and click the "Environment Variables" button
          In the lower "System Variables" frame select "path" and click edit
          Add to the end of the path in the text box ";C:\Program Files\GnuWin32\bin"

      So now you can run tar and gunzip from your command line.

      3. Download following .tar.gz files from http://www.mingw.org/download.shtml

          binutils-2.16.91-20060119-1.tar.gz
          gcc-core-3.4.5-20060117-1.tar.gz
          gcc-g++-3.4.5-20060117-1.tar.gz
          mingw32-make-3.80.0-3.tar.gz
          mingw-runtime-3.9.tar.gz
          mingw-utils-0.3(2).tar.gz
          w32api-3.6.tar.gz

      They are available on Save all of them in C:\MinGW. Create this folder if you dont have one.

      4. Go to Start -> Run -> cmd. Say cd \ and then cd MinGW. So now you are in C:\MinGW.

      5. Run -->> gunzip *.gz in command line.

      6. Then run -->> TyFOR %f IN (*.tar.gz) DO tar xf %f

      7. Now you should see that lots of directories like bin, include, info are created.

      8. Download gdb.exe from and put it on desktop and then run it. It would install gdb on your machine.

      9. Now add following directories to your path ... C:\MinGW\bin.

          Right click "My Computer" on the desktop, and click "System Properties"
          From the dialog that opens, select the "Advanced" tab, and click the "Environment Variables" button
          In the lower "System Variables" frame select "path" and click edit
          Add to the end of the path in the text box ";C:\MinGW\bin"

      With this your MinGW in installed on your machine. Now you can have sample c files compiled with gcc compiler.

      10. Download QT source code file qt-win-opensource-src-4.2.2.zip from http://www.trolltech.com/developer/downloads/qt/windows. Unzip it into C:\Qt directory. Once unzipped when you would go into C:\QT you would find a directory named qt-win-opensource-src-4.2.2. Rename this folder to 4.2.2

      11. Now set environment variable for QT

          A.) Right click "My Computer" on the desktop, and click "System Properties". From the dialog that opens, select the "Advanced" tab, and click the "Environment Variables" button
          B.) Add Qt to the system path as follows
              - In the lower "System Variables" frame select "path" and click edit
              - Add to the end of the path in the text box ";C:\Qt\4.2.2\bin"
          C.) Create two new Qt environment variables as follows
              - In the lower "System Variables" frame click the "New..." button
              - Enter: varable name QTDIR, variable value "C:\Qt\4.2.2\bin"
              - Click OK
              - In the lower "System Variables" frame click the "New..." button
              - Enter: varable name QMAKESPEC, variable value win32-g++
              - Click OK

      12. Goto Start -> Run -> cmd. Run  cd c:\Qt\4.2.2 . Now run following commands line by line

          set QTDIR=C:\Qt\4.2.2
          set PATH=%QTDIR%\bin;C:\MinGW\bin;%PATH%
          set QMAKESPEC=win32-g++
          configure -qt-gif -qt-libpng -qt-sql-sqlite -dont-process
          cd src
          qmake -makefile src.pro
          mingw32-make
          cd ..\tools
          qmake -makefile tools.pro
          mingw32-make

      With this your machine would have compiled QT. Now build frogface as per the help given above by Dec. above as I think I have already duplicated a lot of stuff here :))

       
    • Ganesh

      Ganesh - 2007-02-22

      Hi,

      It really works fine when it's done by following the steps above mentioned but If you're really lazy like me, Then you should go to 'http://www.trolltech.com/developer/downloads/qt/windows' and download
      'qt-win-opensource-4.2.2-mingw.exe' and sure make while Qt installation , MingW32 is installed along with it(it takes a while to download these Mingw sources).

      Now, in 'All Programs',you'll find Qt installed and then run Debug libraries(If you didn't run this, Probably you can't work with it)
      Also, It takes a long time to finish this process(So,fix yourself to some other work).

      Then, follow the steps to build frog face(mentioned by Declan).

      cheers,
      Ganesh.

       

Log in to post a comment.

MongoDB Logo MongoDB