May 19, 2013


(C++) Installation of MinGW with MSYS as a developer's environment.


This manual was created to be a textbook for developers to help them build and customize their own environment for the development of native applications in a family of OS Windows.
Choosing and installation free environment based on the port compiler gcc (MinGW) and Code Blocks IDE environment. And farther configuration, installation and compilation of third-party libraries.


Contents:
1. Installing and configuring toolchain MinGW/MSYS and additional software

1.1. Install MinGW, MSYS shell and customizable environment

1.2. Setting up MinGW / MSYS: employ advanced console instead msys.bat

1.3. Compile and install pkg-config

1.4. Installing CMake, examples

1.5. Installing Subversion (svn)

1.6 Installing git


2. Compile and install libraries in MinGW toolchain

2.1. Compilation and installation of the library FreeGLUT

2.2. Compile and install the GLUT library

2.3. Compiling and installing SDL-library environment

2.3.1. Compiling and installing the main library SDL

2.3.2. Compilation and installation of the library SDL_image

2.3.3. Compilation and installation of the library SDL_net

2.3.4. Compilation and installation of the library SDL_gfx

2.3.5. Compilation and installation of the library SDL_ttf 2.0

2.3.6. Compilation and installation of the library SDL_mixer

2.3.7. Compilation and installation of the library SDL_sound

2.3.8. Compilation and installation of the library SDL_draw

2.3.9. Compilation and installation of the library SDL_console

2.4. Compile and install zlib library

2.5. Compilation and installation of the JPEG library

2.6. Compilation and installation of the PNG library

2.7. Compilation and installation of the TIFF library

2.8. Compilation and installation of the library FreeType 2

2.9. Compiling and installing OGG library

2.10. Compiling and installing OggVorbis (libVorbis) library

2.11. Compiling and installing FLAC library

2.12. Compilation and installation of the library MikMod

2.13. Compilation and installation of the library MAD (libmad)

2.14. Compiling and installing OpenAL library

2.15. Compilation and installation of the library ALUT (freealut)

2.16. Compiling and installing cURL (libcurl) library

2.17. Compilation and installation of the library libmodplug

2.18. Compile and install OpenSSL libraries and utilities

2.19. Compilation and installation of the library Expat


3. MinGW integration with IDE


1. Installing and configuring toolchain MinGW / MSYS and additional software



Let's see what the MinGW, MSYS and what are and what they need.

MinGW - short for «Minimalist GNU for Windows», in essence MinGW is a small
and compact design environment of native applications for the family of OS
Microsoft Windows. MinGW provides a complete set of tools for Open Source
software, which is suitable for the development of a native Windows application
that does not depend on the C-Runtime libraries of any third parties. MinGW
supports the idea of minimalism, so it never will fully support the runtime
POSIX, POSIX applications for deployment on Windows, for their full support
exists Cygwin. First of all, MinGW is intended for use by developers who are
used to working with the compiler gcc. MinGW includes:
  • Port GNU Compiler Collection (GCC), which includes the compilers of languages such as: C, C++, ADA and Fortran.
  • Port GNU Binutils for Windows (as, ld, ar)
  • Console installer (mingw-get) for MinGW and MSYS Graphical installer(mingw-get-inst)
MSYS - short for «Minimal SYStem», a port of the shell Bourne Shell (sh) for
Windows. It is offered as an alternative to «cmd.exe» from Microsoft'a. The
shell is well-suited for porting existing applications and libraries that are in
the * nix systems, and includes a small selection of ports instruments Unix,
facilitating the task of porting.

The combination of MinGW and MSYS provides developers with a small independent
environment that can be easily loaded onto removable media without the need to
add records to the registry files.
Useful links:
Official site MinGW
Vicki on MinGW

Skip to content ↑

1.1. Install MinGW, MSYS shell and customizable environment


1.1.1. Download the official online installer MinGW, at the moment the latest
version of the installer 20120426: mingw-Get-INST-latest.exe
Run the installer,
click «Next», «Next», select «Use pre-packaged repository catalogues»:



Click «Next» and agree to the license again «Next», and now choose the path for the installation:



It is recommended to choose the path without spaces, it is best to install
MinGW to the root of the disk, ie a «C:\MinGW».
I chose the «C:\Qt\MinGW», so it is more convenient to connect to the MinGW IDE QtCreator. If you plan to further integrate its toolchain in which the realties IDE, do the same and click «Next». The need for a group of shortcuts in the "Start" menu - as you wish. But you can not create (by ticking «Don't create a Start Menu folder) and click« Next ».

Select the following packages:
  • C Compiler
  • C++ Compiler
  • MSYS Basic System
  • MinGW Developer ToolKit

and click «Next»



then confirm the installation of the packages click «Install». This will open
a console window in which to display the process of downloading and installing
packages. Make sure that the process is carried out without errors (for
example, if the repository server will not be available, you must try to
install with the same parameters later), and complete the process. Now you need
to add to the PATH environment variable path to the directory «C:\Qt\MinGW\bin». This is done as follows (for Win8, for other systems by analogy):
1.1.1.1. Click the right mouse button on the icon "Computer" and click on the menu item "Properties".
1.1.1.2. Click to the left to select "Advanced system settings" in the window that appears, click the "Environment Variables".
1.1.1.3. In the top list of variables locate the variable «Path», click on it twice to edit.
1.1.1.4. Add the path to the directory «\ bin». In my case it is «C:\Qt\MinGW\bin», path separation is performed symbol ";".



1.1.1.5. More can be read here. All toolchain MinGW and MSYS shell installed.
Now you can install additional programs that help make our lives easier.

1.1.2. Installing extra packages and useful commands and utilities.
Immediately after the installation of MinGW and MSYS will be useful to install
some packages. To do this, run the file «C:\Qt\MinGW\msys\1.0\msys.bat», for which, by the way, it will be useful to create a shortcut, and
type the following commands there (go to the next line the same as pressing
«Enter»):
mingw-get install msys-man 
mingw-get install msys-wget
mingw-get install msys-zip 
mingw-get install msys-unzip 
mingw-get install msys-bzip2
mingw-get install msys-perl 
Command «mingw-get install» similar to the popular on different Linux- distributions, probably familiar to many, the command «apt-get install». Both of these commands you to download and install the appropriate package from the repositories. The list of available packages for installation, you can see the command «mingw-get show», for better perception of it can be sorted as follows:
mingw-get show | grep "Package:"
Remove an installed package, use the command «mingw-get remove
vybrannyy_vami_paket" Update the package with the command «mingw-get upgrade
vybrannyy_vami_paket" command «mingw-get upgrade» update all your packages
toolchain completely. In this basic setup toolchain finished, you can begin to assemble / transport projects, or more fine-tuning.
1.1.3. What other tools would be helpful to use with MinGW? To edit the source code and other files,
you can use the console editor «vim», which comes bundled with MinGW'om. But if you're used to the windowing interface, use the excellent editor - Notepad++ .
To unpack the archive's contents, you can use console commands or historian
with the GUI, such as WinRar, for example. Personally, I recommend using - 7-zip .
1.1.4. What can you read? References can be found here:
http://www.linuxcenter.ru/
Basics console commands
Command language interpreter shell
Most necessary *nix commands to handle the I/O

1.2. Setting up MinGW / MSYS: employ advanced console instead msys.bat


Perhaps many developers standard was caused by «msys.bat» seem dull and boring:

Another would be to work in a console quite uncomfortable, if only because of
the lack of normal copypaste. But fortunately, there is a project called - ConEmu from Maximus5 and that is a fork of advanced ConEmu by Zoin. ConEmu - this is a very convenient and attractive terminal that supports tabs. His detailed description written by the author of this program can be found  here . The most important advantage for me is the normal copy-paste. Here he realized just great with the left mouse button or a combination of «Alt + Left mouse button" can select a block or a string to the console, respectively. Immediately after the separation line automatically copied to the clipboard. Keyboard shortcut «Ctrl + V» or click the left mouse button inserts the first line of the buffer, and the «Shift + Insert + Enter» insert all rows at once. For ligament ConEmu and MinGW, we need to download a
specially prepared packages ConEmu for MinGW .
Installation is very simple and trivial - just need to unpack «-mingw32» and «-mingw64» packages in the root folder of the compiler (in my case it «C:\Qt\MinGW»). If you do not want to configure the console, you can download already configured: Download ConEmu.zip, 1.7 MB
It looks as follows (clickable image)



And the set is similar. In my opinion socket-style terminal Quake, checking out
top of the screen by pressing the «Ctrl + ~», not only looks impressive, but
also very easy to use. If desired, of course, can all be very, very flexible
configuration for themselves, ConEmu program is highly customizable and
compatible with the latest OS family of Windows.

Skip to content ↑

1.3. Compile and install pkg-config utility



Official site pkg-config: http://pkg-config.freedesktop.org/
pkg-config is a utility that provides a common interface for information about the software
installed on the system libraries to compile programs from source code. In our
case it is needed to compile some libraries and projects.
1.3.1. Download the latest source pkg-config, as of this writing is 0.27.1:
pkg-config-0.27.1.tar.gz
1.3.2. Unpack the archive into a folder «C:\Qt\build»,
source pkg-config'a should be in the folder «C:\Qt\build\pkg-config-0.27.1».
1.3.3. Compile the pkg-config and library GNU C Library (glibc),
extending included: Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
and type in the console window the following command: By the way, a small but
useful advice! If you have a multicore processor, when you call the make
utility, you can use the key «-jX», where X - number of simultaneous streams
compilation, which depends on the number of processor cores n. It is generally
recommended to take X = n + 1, but if the processor supports Hyper-trheading,
the number of threads to take X = 2 · N + 1. That is, the compilation
commands for dual-core processors will be as follows:
«make-j3» and «make-j3install».
Parallelism is compiling the assembly of large projects is greatly reduced.
cd /c/Qt/build/pkg-config-0.27.1 
./configure-with-internal-glib-prefix=/mingw
make 
make install
The utility and library to compile and install.
1.3.4. To work around bug in MSYS, should be performed in the console block of commands:
cat > /mingw/bin/pkg-config.sh << "EOF"
#!/bin/sh
if pkg-config "$@" > /dev/null 2>&1 ; then
res=true
else
res=false
fi
pkg-config "$@" | tr -d \\r && $res
EOF
This will create a file «pkg-config.sh» in folder «C:\Qt\MinGW\bin»
1.3.5. Now you need to make a script executive and add a variable to an alternative environment:
chmod ugo+x/mingw/bin/pkg-config.sh && \ 
echo "PKG_CONFIG=/mingw/bin/pkg-config.sh" >> /etc/profile.local && \ 
echo "export PKG_CONFIG" >> /etc/profile.local
1.3.6. When you need an alternative environment, you can always load the following command:
source /etc/profile.local
Skip to content ↑

1.4. Installing CMake, examples


Official site CMake:  http://www.cmake.org
CMake(cross platform make) - a cross-platform automation system for the generation of files for building
software from source code. CMake is not directly involved in the assembly
source code, it only generates files for your build project from files
«CMakeLists.txt». It may be:

  • Conventional Makefile, which are used on Unix systems to be assembled with the utility make;
  • Files projects/workspaces(*.Dsp/*.Dsw) on Windows systems for the assembly using the Microsoft Visual C++;
  • Projects XCode on Mac OS X.


  • 1.4.1 Installing CMake:
    1.4.1.1. Download the installation package CMake from the official site (latest version as of this writing - 2.8.11):  cmake-2.8.11-win32-x86.exe
    1.4.1.2. Save the installation package in any convenient place and run «cmake-2.8.11-win32-x86.exe».
    1.4.1.3. Now click "Next", agree to the license, select the item «Add CMake to the system PATH for all users»



    This option is set in the environment variable PATH the folder in which to
    install CMake. Create a shortcut on request, we click "Next."
    1.4.1.4. Select the folder in which to install CMake. I recommend choosing
    a folder «C:\Qt\CMake», since then can be easily integrated development environment (IDE).
    Now click "Next".
    1.4.1.5. If desired, you can create a shortcut in the "Start" menu. We click
    "Install" and wait for the installation click "Finish". That's it! CMake
    installed.

    1.4.2 Examples of using CMake:
    1.4.2.1. A bit basic, general advice. To build the project using CMake in the root directory
    of the project file is created «CMakeLists.txt», describing the project and its dependencies. Examples of compiling libraries with the utility CMake can be found here:
    Compiling and installing OpenAL library
    Compilation and installation of the library ALUT (freealut)
    1.4.2.2. Example of «CMakeLists.txt» to build example «oldglutdemo.c»
    of paragraph 2.2.9.1, using the library GLUT:
    project(GLUT-Req)
    cmake_minimum_required(VERSION 2.8)
    aux_source_directory(. SRC_LIST)
    
    set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:/Qt/MinGW/lib")
    set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:/Qt/MinGW/include/GL;C:/Qt/MinGW/include")
    
    ##########################################################
    find_package(OpenGL REQUIRED)
    if(NOT OPENGL_FOUND)
        message(SEND_ERROR "Failed to find OpenGL")
        return()
    else()
        include_directories(${OPENGL_INCLUDE_DIR})
    endif()
    ##########################################################
    find_package(GLUT REQUIRED)
    if(NOT GLUT_FOUND)
        message(SEND_ERROR "Failed to find GLUT")
        return()
    else()
        include_directories(${GLUT_INCLUDE_DIR})
    endif()
    ##########################################################
    
    link_libraries(${OPENGL_LIBRARY} ${GLUT_LIBRARIES})
    add_executable(${PROJECT_NAME} ${SRC_LIST})
    

    The text above is necessary to select and save a file with the name «CMakeLists.txt», then the file «oldglutdemo.c» and «CMakeLists.txt» should be placed in a separate folder, for example «C:\Qt\build\GLUT\glut-3.7.6\cmake-test». Next, type in the console window the following command:
    cmake -G "MSYS Makefiles"
    make
    make install
    
    And as a result we obtain the executable file «GLUT-Req.exe». Pay attention to:
    set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:/Qt/MinGW/lib")
    set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:/Qt/MinGW/include/GL;C:/Qt/MinGW/include")
    
    Without setting these variables CMake does not see the library GLUT.
    1.4.2.3. Variables:
    cmake -DCMAKE_INSTALL_PREFIX:PATH="/mingw" -DCMAKE_C_FLAGS:STRING="-march=i686" -DCMAKE_CPP_FLAGS:STRING="" -DCMAKE_CXX_FLAGS:STRING="" \
    -DCMAKE_EXE_LINKER_FLAGS:STRING="-L/usr/local/lib -L/opt/local/lib" -DCMAKE_MODULE_LINKER_FLAGS:STRING="-L/usr/local/lib -L/opt/local/lib" \
    -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L/usr/local/lib -L/opt/local/lib" -G "MSYS Makefiles"
    
    From the names of all the variables should be clear:
    -DCMAKE_INSTALL_PREFIX:PATH #- path where the application will be installed after the "make install".
    -DCMAKE_C_FLAGS:STRING #- Set flags for the file "*. C"
    -DCMAKE_CPP_FLAGS:STRING / -DCMAKE_CXX_FLAGS:STRING #- Set flags for the file "*.cpp" and "*.
    -DCMAKE_EXE_LINKER_FLAGS:STRING / -DCMAKE_MODULE_LINKER_FLAGS:STRING / -DCMAKE_SHARED_LINKER_FLAGS:STRING #- Setting file linking.
    
    1.4.2.4. Cross Compilation with CMake. In the project folder create a file with the extension «.cmake», for example, «Toolchain-eldk-ppc74xx.cmake», with content like this:
    # this one is important
    SET(CMAKE_SYSTEM_NAME Linux)
    #this one not so much
    SET(CMAKE_SYSTEM_VERSION 1)
    
    # specify the cross compiler
    SET(CMAKE_C_COMPILER   /opt/eldk-2007-01-19/usr/bin/ppc_74xx-gcc)
    SET(CMAKE_CXX_COMPILER /opt/eldk-2007-01-19/usr/bin/ppc_74xx-g++)
    
    # where is the target environment 
    SET(CMAKE_FIND_ROOT_PATH  /opt/eldk-2007-01-19/ppc_74xx /home/alex/eldk-ppc74xx-inst)
    
    # search for programs in the build host directories
    SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
    # for libraries and headers in the target directories
    SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
    SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
    
    And configure the project:
    cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-eldk-ppc74xx.cmake
    
    More information can be found here: CMake Cross Compiling

    1.4.3 What to read about CMake? (Literature):
    Among the most useful:
    1. CMake Documentation
    2. CMake Wiki
    3. Pau Garcia's. Learning CMake.

    1.5. Installing Subversion (svn)


    Official site git: http://subversion.apache.org/
    Subversion, or svn, is a free centralized version control system, has been released in 2004 by CollabNet Inc.
    1.5.1. Setting svn from a binary package:
    1.5.1.1. In order to get a binary package svn, you have to register on the site
    http://www.collab.net/
    1.5.1.2. After registration, go to the download page
    http://www.collab.net/downloads/subversion
    and load the latest version of «Subversion command-line binaries», a version of its operating system. At the time of this writing, the latest version 1.7.9.
    1.5.1.3. Installation is extremely simple. Run the installer and choose the installation path, for
    example, «C:\Qt\SVN», then press «Next» and Subversion installed.
    1.5.1.4. Test it by typing in the console svn. After launching a line appears to «Type 'svn help' for usage.»

    1.5.2. A list of useful commands and tips: In addition CollabNetSubversion there
    is another version of the Subversion client for Windows with deeper integration
    into the conductor is TortoiseSVN .
    Commands:
    # get the files from the repository, complete command: svn checkout
    svn co http://(svn://)repository.url/svn/name 
    # receive updates from the repository, complete command: svn update
    svn up 
    # extract the revision of the file with the number rev_num
    svn update -r rev_num ./file_name
    # add the file to the repository (text or binary)
    svn add ./filename
    # update the file into the repository (text or binary)
    svn commit ./filename 
    # rename the file in the repository
    svn rename ./old_filename ./new_filename 
    # delete the file directory from the repository
    svn remove ./file_name  
    # peruse locally modified files, full command: svn status 
    svn st
    # peruse locally modified or changed in the repository files
    svn st -u 
    # shows local changes to a file line by line
    svn diff ./filename 
    # shows the differences between two revisions of a file
    svn diff -r rev_num1:rev_num2 ./filename  
    # rolls back the local changes of the file that is currently in the repository
    svn revert ./filename
    # rolls back all of the local file changes
    svn revert -R ./
    # list of revisions with comments
    svn log ./filename 
    # shows the authors change the file line by line
    svn blame ./filename 
    # unlocks files
    svn cleanup 
    # Show file information
    svn info ./filename 
    # unlock the file
    svn unlock http://repository.url/svn/file_name 
    # create branch
    svn copy http://repository.url/svn/name/trunk/ http://repository.url/svn/name/branches/new_branch_name/ 
    # synchronizes your branch to the trunk
    svn merge -r rev_num1:rev_num2 http://repository.url/svn/name/trunk/ 
    

    1.6 Installing git


    Official site git: http://git-scm.com/
    git - a distributed version control
    system files. Git project was created by Linus Torvalds to ease the process of
    managing the development of the kernel Linux, the first version of git'a
    released April 7, 2005. Today, many projects use git, the largest and most
    important: the kernel Linux, Android, MediaWiki.

    1.6.1. Download the stable version of git installer from the official site (currently the latest version 1.8.3): Git-1.8.3-preview20130201.exe ,
    git is fully compatible with the environment MinGW.
    1.6.2. Run the installer and follow the instructions.
    After installing git takes about 220 MB. I installed git in folder «C:\Qt\Git»
    with the following parameters (you can enlarge the image by clicking)



    1.6.2.1. Git ready to go! If you had the console is running, restart it, and
    make sure that git was prescribed in the PATH and called by command «git».
    1.6.3. Useful commands and tips, create our first repository on github.com :
    1.6.3.1. Register on github.com (Sign up) and confirm the e-mail.
    1.6.3.2. Create a new repository: github.com/new ,
    fill thre all fields. After filling press the button «Create Repository».
    1.6.3.3. Now on to the local computer, you must create a key and store it in a profile on
    githabe. To do this, enter the following in a terminal:
    cd ~/.ssh
    mkdir key_backup
    cp id_rsa* key_backup
    rm id_rsa*
    ssh-keygen -t rsa -C "your_reg_github_email@youremail.com"
    # after the line (.ssh /id_rsa) press "Enter".
    Enter passphrase (empty for no passphrase):
    # Here we enter a passphrase (text does not appear, 
    # do not be afraid), accept it and press "Enter".
    clip < ~/.ssh/id_rsa.pub
    
    The generated key is copied to the clipboard after the last command.
    1.6.3.4. Now we just need to go to the github to configure ssh ,
    click «Add Key», copy the key to a big field and confirm the action.
    1.6.3.5. The next step - creating a local repository on your computer. Let's create a folder for the job «C:\Qt\Repo». And enter the following commands in the terminal:
    cd /c/Qt/Repo
    git config --global user.email "your_register_on_github@mail.com"
    git config --global user.name "your_nickname_on_github"
    touch README.md
    echo "# Hello GitHub\!" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/Ваше_имя/Test.git
    git push -u origin master
    
    Running the commands you asked for the name and password you entered during the
    registration. If you go by ssh (git@github.com: YourName/Test.git), you will
    be prompted to enter a passphrase. Do not run into the repository file is
    added to the githabe «README.md».

    1.6.3.6. git command description.
    # set your inbox.
    git config --global user.email "your_register_on_github@mail.com" 
    # set your name globally.
    git config --global user.name "your_nickname_on_github"
    # initialize a new repository.
    git init
    # add new files to the repository (indexing).
    git add .
    # allows you to see what files are in the waiting area.
    git status
    # reset the entire index
    git reset
    # remove from the index, changing a particular file.
    git reset - filename
    # save the changes.
    git commit -m "Initial commit"
    # for a list of your fixations.
    git log
    # roll back to a previous commit.
    git checkout -f
    
    ======== Sending to server GitHub: ========
    git remote add origin git@github.com:username/name_repo.git
    git push origin master
    ===========================================
    
    # creation of a new branch of the repository and the transition to it.
    git checkout -b name_branch
    # enumeration list of local branches.
    git branch
    # the main branch transition.
    git checkout master
    # association the current branch with the name_branch.
    git merge name_branch
    # removing branch
    git branch -d name_branch
    
    ======== To submit changes to GitHub: ========
    # Send changes from the master branch in the experimental branch of the remote repository.
    git push
    git push ssh://yourserver.com/~you/proj.git master:experimental
    # In the remote repository origin remove the branch experimental.
    git push origin :experimental
    # To the remote master branch repository origin (synonym default repository)
    # Send the changes from the local branch master.
    git push origin master:master
    
    ======== Create a copy from the remote repository: ========
    git clone git://github.com/username/project.git master
    ===========================================================
    
    git pull - pick up the latest changes in the project.
    git rm FILE1 FILE2 - delete the file from the repository.
    
    1.6.3.7.  What can read about git?  Also  Git Reference
     and wonderful  Git Tutorial by Lars Vogel .

    2. Compile and install libraries in MinGW toolchain


    To build and create a variety of projects, you may need different library.
    This section describes how to build and install the most popular and used by
    libraries. Installation of most libraries is as simple as copying the header files,
    static and dynamic libraries in the corresponding root directory of the toolchain
    MinGW. Files with the extension «*.dll» - is a dynamic library,
    they are copied to a directory «C:\MinGW\bin»,
    files with the extension «*.lib» or «*.a» -
    static library containing the packed object modules, their in «C:\MinGW\lib».
    Header files with extensions «*.h», «*.hxx» or «*.hpp» must be in «C:\MinGW\include».
    If you install the pre-compiled library, check whether it is possible to use it with the object modules, which generates a compiler MinGW.

    Skip to content ↑

    2.1. Compilation and installation of the library FreeGLUT


    Description: Official site: http://freeglut.sourceforge.net/
    FreeGLUT - it's free and open source implementation of
    the library OpenGL Utility Toolkit (GLUT),
    FreeGLUT library provides the user with options to create and manage
    windows containing OpenGL-context on different platforms, in addition, the
    library allows you to monitor keyboard events, mouse and joystick. It is
    desirable to use that library FreeGLUT, instead of the old GLUT as the library
    is significantly more stable than the relatively new operating systems (Windows Vista, 7, 8) and supports OpenGL version 3.1.
    FreeGLUT released under license  X-Consortium .

    Assembling:
    2.1.1. Download the latest source library FreeGLUT, as of this writing is 2.8.1:
    freeglut-2.8.1.tar.gz
    2.1.2. Unpack the archive into a folder «C:\Qt\build\GLUT», source libraries should be in
    the folder «C:\Qt\build\GLUT\freeglut-2.8.1».
    2.1.3. Run «C:\Qt\MinGW\msys\1.0\msys.bat» or comfortable ConEmu,
    installation of which I described above and type in the console window the following commands:
    cd /c/Qt/build/GLUT/freeglut-2.8.1
    ./configure --prefix=/mingw
    make
    make install
    
    2.1.4. Compiled dynamic and static libraries, header files must be copied to
    the appropriate folder. Dynamic «libglut-0.dll» in «C:\Qt\MinGW\bin»
    Static «libglut.a» and «libglut.dll.a» in «C:\Qt\MinGW\lib»
    Headers in «C:\Qt\MinGW\include\GL»
    2.1.5. Compile and run the demo code:
    2.1.5.1. Create a file «glutdemo.c» in folder «C:\Qt\build\GLUT», and inserted into it the content:
    #include <GL/freeglut.h>
    
    void display()
    {
        glClear(GL_COLOR_BUFFER_BIT);
        glClearColor(1.0f, 0.0f, 0.0f, 0.0f);
        glFlush();
    }
    
    int main(int argc, char **argv)
    {
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
        glutCreateWindow("Demo");
        glutDisplayFunc(display);
        glutMainLoop();
        return 0;
    }
    
    and save.

    2.1.5.2. To compile the code, run the «C:\Qt\MinGW\msys\1.0\msys.bat»
    and type in the console window the following commands:
    cd /c/Qt/build/GLUT
    gcc -mwindows glutdemo.c -o glutdemo -lopengl32 -lglut
    ./glutdemo.exe
    
    These commands will compile the code into the executable file «glutdemo.exe»,
    which will be created when you start the window, fully painted in red:



    Parameter -mwindows need for the application to run without a console window,
    if you need a console window, compile without this option or option -mconsole.
    It should be noted that running «glutdemo.exe» must be added to the PATH
    environment variable path «C:\Qt\MinGW\bin», for details see paragraph 1.1.1.1.

    Skip to content ↑

    2.2. Compile and install the GLUT library



    Description: Official site of the port for Win32: http://user.xmission.com/~nate/glut.html
    GLUT (OpenGL Utility Toolkit) is a library of tools for
    applications on OpenGL, which is mainly responsible for system I/O level
    at work with the operating system. With GLUT can easily create a window and run it.
    In addition library allows you to: draw a number of simple geometric primitives,
    track keyboard and mouse events, create simple pop-up menus, etc. GLUT can
    facilitate learning OpenGL, so as to use it without knowing the windowing API.
    The GLUT library was written Mark'om Kilgard'om, and then ported to Windows
    Nate Robins. It should be noted that the port of the GLUT library has not
    been updated since 2001, the year of its implementation works quite unstable in
    modern operating systems, so it is recommended to replace a new library FreeGLUT.

    Assembling:
    2.2.1. Download the latest source library GLUT, as of this writing is 3.7.6:
    GLUT-3.7.6-src.zip
    2.2.2. Unpack the archive into a folder «C:\Qt\build\GLUT»,
    source libraries should be in the folder «C:\Qt\build\GLUT\glut-3.7.6».
    2.2.3. Open the file «C:\Qt\build\GLUT\glut-3.7.6\include\GL\glut.h»
    and add the following
    #ifdef __MINGW32__
    #define APIENTRY __stdcall
    #define CALLBACK __stdcall
    #endif
    
    then save the file.
    2.2.4. Open the file «C:\Qt\build\GLUT\glut-3.7.6\lib\glut\win32_winproc.c»
    and comment line # 21:
    //#include <crtdbg.h>
    
    2.2.5. Open the file «C:\Qt\build\GLUT\glut-3.7.6\lib\glut\win32_util.c»
    and edit function int gettimeofday (struct timeval * tp, void *tzp) as follows:
    Look at a condition if (QueryPerformanceCounter (& t)) (line # 35)
    and replace the body of it with:
    LARGE_INTEGER f;
    double t_over_f;
    QueryPerformanceFrequency(&f);
    tp->tv_sec = t.QuadPart/f.QuadPart;
    t_over_f = ((double)t.QuadPart/f.QuadPart);
    tp->tv_usec = (t_over_f - tp->tv_sec)*1000*1000;
    
    This will give us a normal job functions glutTimerFunc()
    with the system Windows Vista, 7 and 8.
    2.2.6. Download this  Makefile ,
    created specifically to build the library GLUT, and drag it to the
    folder «C:\Qt\build\GLUT\glut-3.7.6».
    2.2.7. Compile and install the library: Run «C:\Qt\MinGW\msys\1.0\msys.bat» and type in the console window the following commands:
    cd /c/Qt/build/GLUT/glut-3.7.6
    make
    make install
    
    2.2.8. Compiled dynamic and static libraries, header files must be copied to
    the appropriate folder: Dynamic «glut32.dll» in «C:\Qt\MinGW\bin»
    Static «libglut32.a» in «C:\Qt\MinGW\lib»
    Heder «glut.h» in «C:\Qt\MinGW\include\GL»
    Archive source  GLUT-3.7.6_edit.7z ,
    if you are too lazy to add the changes themselves, simply unzip the archive to
    a folder «C:\Qt\build\GLUT», and follow the procedures of paragraph 2.2.7.
    The archive has already been applied fixes that are described in the paragraphs above.

    2.2.9. Compile and run the demo code.
    2.2.9.1. Create a file «oldglutdemo.c» folder «C:\Qt\build\GLUT»,
    with the following content:
    #include <GL/glut.h>
    
    void display()
    {
        glClear(GL_COLOR_BUFFER_BIT);
        glColor3f(1.0f, 0.0f, 0.0f);
        glBegin(GL_QUADS);
            glVertex2f(-0.5, 0.5);
            glVertex2f(0.5, 0.5);
            glVertex2f(0.5, -0.5);
            glVertex2f(-0.5, -0.5);
        glEnd();
        glFlush();
    }
    
    int main(int argc, char **argv)
    {
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
        glutCreateWindow("Demo");
        glutDisplayFunc(display);
        glutMainLoop();
        return 0;
    }
    
    and save.
    2.2.9.2. To compile and run the code run «C:\Qt\MinGW\msys\1.0\msys.bat»
    and type in the console window the following commands:
    cd /c/Qt/build/GLUT
    gcc -mwindows oldglutdemo.c -o oldglutdemo -lopengl32 -lglut32
    ./oldglutdemo.exe
    
    Application «oldglutdemo.exe» create a window with a red square in the center:



    Skip to content ↑

    2.3. Compiling and installing SDL-library environment


    In its structure, SDL library is not a full SDK (Software Development Kit) for
    game developers because they do not include high-level functions for graphics,
    sounds and external devices. But thanks to the fact that it provides direct
    access to the graphics system, sound card, input devices (keyboard, mouse,
    joystick), CD-ROM drive, a timer and it implements some low-level functions for
    working with graphics and sound, it is quite possible library used to design
    not too difficult to port existing applications or where the SDL library will
    be used as a blitter. The library is implemented only the minimum necessary
    functions, it is not inflated by tens of megabytes and is reasonably fast. At
    its core is the SDL framework for other libraries that support more advanced
    features in one area (graphics, audio mixing and support for various file
    formats, GUI,. Etc). And together with these additional SDL libraries and
    forms a fairly versatile, though already out of date, SDK for game developers.
    In this section, I will discuss the assembly Chastoispolzuemyh libraries SDL.
    Some of them are officially supported, some supported by third-party
    developers. Assembly of the SDL-environment for MinGW allows you to easily
    move a lot of games on the Windows platform.

    Skip to content ↑

    2.3.1. Compiling and installing the main library SDL


    Description: Official site: http://www.libsdl.org/
    Library Simple DirectMedia Layer (SDL) provides a single software interface to
    the graphics subsystem, audio devices and means of entry for a wide range of platforms.
    It is widely used for writing multimedia applications: games, emulators or players,
    and is asort of likeness «DirectX» for numerous platforms. More details
    about this library can be found  here .

    Assembling:
    2.3.1.1. Download the latest source SDL library from the official website, as of
    this writing is 1.2.15: SDL-1.2.15.tar.gz
    2.3.1.2. Unpack the archive into a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL-1.2.15».
    2.3.1.3. Compile and install the SDL-library: Run «C:\Qt\MinGW\msys\1.0\msys.bat»
    and type in the console window the following commands:
    cd /c/Qt/build/SDL/SDL-1.2.15
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring.
    The list of available options can be found by typing
     ./Configure --help
    
    For example, the option «--enable-stdio-redirect=no» disables files
    «stdout.txt» and «stderr.txt», which are created when you run the program,
    and sends the output to the console window.

    2.3.1.4. Compiled dynamic and static libraries, header files must be copied to the
    appropriate folder: Dynamic «SDL.dll» in «C:\Qt\MinGW\bin»
    Static «libSDL.a», «libSDL.dll.a» and «libSDLmain.a»
    in «C:\Qt\MinGW\lib» Headers in «C:\Qt\MinGW\include\SDL»
    2.3.1.5. Starting and compile a small demo code: Create a file «sdldemo.c»
    folder «C:\Qt\build\SDL» with the following contents:
    #include <SDL/SDL.h>
    #include <SDL/SDL_opengl.h>
    
    void display()
    {
        glClear(GL_COLOR_BUFFER_BIT);
        glColor3f(1.0f, 0.5f, 0.0f);
        glBegin(GL_TRIANGLES);
        glVertex2f(-1.0, -1.0);
        glVertex2f(0, 1.0);
        glVertex2f(1.0, -1.0);
        glEnd();
        glFlush();
        SDL_GL_SwapBuffers();
    }
    
    void SDL_Loop()
    {
        Uint8 *keys;
        int done = 0;
        while (!done)
        {
            SDL_Event event;
            display();
            while (SDL_PollEvent(&event))
            {
                switch(event.type)
                {
                case SDL_QUIT:
                    done = 1;
                    break;
                }
            }
            keys = SDL_GetKeyState(NULL);
            if (keys[SDLK_ESCAPE])
              done = 1;
        }
    }
    
    int main(int argc, char *argv[])
    {
        SDL_Surface *screen;
        SDL_Init(SDL_INIT_VIDEO);
        screen = SDL_SetVideoMode(200, 200, 16, SDL_OPENGL);
        SDL_Loop();
        SDL_Quit();
        return 0;
    }
    
    and save. To compile and run the code run «C:\Qt\MinGW\msys\1.0\msys.bat»
    and type in the console window the following commands:
    cd /c/Qt/build/SDL
    gcc -mwindows sdldemo.c -o sdldemo -lmingw32 -lSDLmain -lSDL -lopengl32
    ./sdldemo.exe
    
    Application «sdldemo.exe» creates simple and small box with an orange triangle in the center:



    Skip to content ↑

    2.3.2. Compilation and installation of the library SDL_image


    Description:
    Official site: http://www.libsdl.org/projects/SDL_image/
    SDL_image library is an extension of the core library and allows you
    to use in SDL applications a variety of image formats, not confining «*.bmp».
    SDL_image allows programmers to easily use multiple formats
    without having to write adownloads and conversions functions.
    Assembly:
    Attention! Dependencies:
    zlib library
    JPEG library
    PNG library
    TIFF library (optionally. I have not used since a negligible number of projects using image format «*. tiff»).
    Before compiling the library, compile and install all the dependencies!
    2.3.2.1. Download the latest stable version of the source
    code library SDL_image, at the time of this writing,
    the latest version 1.2.12:  SDL_image-1.2.12.tar.gz
    2.3.2.2. Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL_image-1.2.12».
    2.3.2.3. Compile and install the library SDL_image:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type in the
    console window the following commands:
    cd /c/Qt/build/SDL/SDL_image-1.2.12
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.3.2.4. Compiled dynamic and static libraries, header files must be copied to
    the appropriate folders:
    Shared Library «SDL_image.dll» in «C:\Qt\MinGW\bin»
    Static «libSDL_image.a» in «C:\Qt\MinGW\lib»
    Headers in «C:\Qt\MinGW\include\SDL»
    2.3.2.5. The installation is complete. If desired, you can compile
    the utility «showimage.exe»:
    cd /c/Qt/build/SDL/SDL_image-1.2.12
    gcc showimage.c -o showimage -I/mingw/include/SDL -lmingw32 -lSDLmain -lSDL -lSDL_image -mwindows
    
    If start «showimage.exe» and drag any image on - it will opens in a window.

    Skip to content ↑

    2.3.3. Compilation and installation of the library SDL_net


    Description:
    Official site: http://www.libsdl.org/projects/SDL_net/
    The network library SDL_net is an extension of the basic SDL library and
    allows you to use SDL-network in applications.
    SDL_net allows programmers to easily create network connection and operates
    on data transfering options.
    Code written using the functions of the library, will be cross-platform.

    Assembling:
    2.3.3.1. Download the latest stable version of the source code library SDL_net,
    at the time of this writing, version 1.2.8: SDL_net-1.2.8.tar.gz
    2.3.3.2. Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL_net-1.2.8».
    2.3.3.3. Compile and install the library SDL_net: Run «C:\Qt\MinGW\msys\1.0\msys.bat»
    or ConEmu and type in the console window the following commands:
    cd /c/Qt/build/SDL/SDL_net-1.2.8
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.3.3.4. Compiled dynamic and static libraries, header files must be copied
    to the appropriate folders:
    shared Library «SDL_net.dll» in «C:\Qt\MinGW\bin»
    static «libSDL_net.a» in «C:\Qt\MinGW\lib» Header «SDL_net.h» in «C:\Qt\MinGW\include\SDL»

    Skip to content ↑

    2.3.4. Compilation and installation of the library SDL_gfx


    Description:
    Official site: http://www.ferzkopp.net/joomla/content/view/19/14/
    SDL_gfx library contains the functions of drawing primitives and work with
    images, sprites (scaling, rotation, filters, etc.). It evolved from a project
    SDL_gfxPrimitives, that represented the basic procedures for drawing primitives
    such as lines, circles and polygons. The library does not apply to official,
    but a large number of projects use it.

    Assembling:
    2.3.4.1. Download the latest stable version of the source code
    library SDL_gfx, at the time of this writing, the latest version 2.0.24:
    SDL_gfx-2.0.24.tar.gz
    2.3.4.2. Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL_gfx-2.0.24».
    2.3.4.3. Compile and install the library SDL_gfx:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type
    in the console window the following commands:
    cd /c/Qt/build/SDL/SDL_gfx-2.0.24
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
     
    ./configure --help
    
    2.3.4.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared Library «libSDL_gfx-13.dll» in «C:\Qt\MinGW\bin»
    static «libSDL_gfx.a» and «libSDL_gfx.dll.a» in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\SDL»
    2.3.4.5. The installation is complete. If desired, you can compile the utility
    «TestGfxTexture.exe»:
     
    cd /c/Qt/build/SDL/SDL_gfx-2.0.24/Test
    gcc TestGfxTexture.c -o TestGfxTexture -I/mingw/include/SDL -lmingw32 -lSDLmain -lSDL -lSDL_gfx -mwindows
    ./TestGfxTexture
    
    When you start it a window showing the result of texturing.

    Skip to content ↑

    2.3.5. Compilation and installation of the library SDL_ttf 2.0



    Description:
    Official site: http://www.libsdl.org/projects/SDL_ttf/
    SDL_ttf 2.0 is a library of font rendering TrueType, and is used in conjunction with a
    library of SDL. This allows programmers to use TrueType fonts without writing
    native font rendering. Thanks to the scalability of fonts and anti-aliasing can
    get high quality text output without much effort.

    Assembling:
    Attention! Dependencies: FreeType 2 library
    Before compiling the library, compile and install all the dependencies!
    2.3.5.1. Download the latest stable version of the source code library SDL_ttf 2.0,
    at the time of this writing, the latest version 2.0.11: SDL_ttf-2.0.11.tar.gz
    2.3.5.2. Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL_ttf-2.0.11».
    2.3.5.3. Compile and install the library SDL_ttf 2.0:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type
    in the console window the following commands:
     
    cd /c/Qt/build/SDL/SDL_ttf-2.0.11
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
     
    ./configure --help
    
    2.3.5.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared Library «SDL_ttf.dll» in «C:\Qt\MinGW\bin»
    static «libSDL_ttf.a» and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\SDL»
    2.3.5.5. The installation is complete.
    If desired, you can compile the utility «showfont.exe»:
     
    cd /c/Qt/build/SDL/SDL_ttf-2.0.11
    gcc showfont.c -o showfont -I/mingw/include/SDL -lmingw32 -lSDLmain -lSDL -lSDL_ttf
    
    If onto «showfont.exe» drag any «*.ttf» font - it will open in a window.

    Skip to content ↑

    2.3.6. Compilation and installation of the library SDL_mixer


    Description:
    Official site: http://www.libsdl.org/projects/SDL_mixer/
    SDL_mixer is a library of sound mixing, which can be used in conjunction with a
    library of SDL. It allows programmers to use the sounds with the music and do not
    write their own mixers. The library also simplifies uploading, processing, and playback
    of sounds and music of various file formats, we will assembly a configuration library
    can support formats such as «*.mp3», «*.ogg», «*.flac», «*.mod» and several other.

    Assembling:
    Attention! Dependencies:
    Library OGG
    Library OggVorbis (libVorbis)
    Library FLAC
    Library MikMod
    Library MAD (libmad)
    Before compiling the library, compile and install all the dependencies!
    2.3.6.1. Download the latest stable version of the source code library SDL_mixer,
    at the time of this writing, the latest version 1.2.12: SDL_mixer-1.2.12.tar.gz
    2.3.6.2. Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL_mixer-1.2.12».
    2.3.6.3. Open the file «C:\Qt\build\SDL\SDL_mixer-1.2.12\ Makefile.in»
    and replace the same line # 69 and # 72:
     
    $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)
    
    to the line
     
    $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(objects)/$(TARGET) $(SDL_LIBS)
    
    after replacing save the file.
    2.3.6.4. Compile and install the library SDL_mixer:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type
    in the console window the following commands:
     
    export LIBS="-L/mingw/lib -logg -lws2_32"
    cd /c/Qt/build/SDL/SDL_mixer-1.2.12
    ./configure --enable-music-mp3-mad-gpl --disable-music-mp3 --disable-music-fluidsynth-midi --prefix=/mingw
    make
    make install
    export -n LIBS
    
    We strongly recommend the use of a decoder MAD, instead of
    the old and unstable smpeg.
    Line export LIBS=«-L/mingw/lib-logg-lws2_32» is needed to pick up
    a FLAC, without it «conftest.c» can not link against.
    If you need any special parameters, they can always be changed before configuring.
    The list of available options can be found by typing
     
    ./configure --help
    
    2.3.6.5. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared Library «SDL_mixer.dll» in «C:\Qt\MinGW\bin»
    static «libSDL_mixer.a» and the rest in «C:\Qt\MinGW\lib»
    header «SDL_mixer.h» in «C:\Qt\MinGW\include\SDL»
    2.3.6.6. The installation is complete. To verify the correctness of the library, you can
    compile a simple player «sdlwav.exe». To do this, download the file
    "sdlwav.c " , save it to a folder« C:\Qt\build\SDL»
    and compile it as follows:
     
    cd /c/Qt/build/SDL
    gcc sdlwav.c -o sdlwav -I/mingw/include/SDL -lmingw32 -lSDLmain -lSDL -lSDL_mixer
    
    Now if «sdlwav.exe» drag any file containing music or audio
    format «*mp3», «*.flac», «*.ogg», «*.wav»
    or «*.mod» - it will be played,
    in addition, it should open the window of a simple visualizer, if the window with
    it actively you can rewind the track or the arrow keys on your keyboard to put
    it on pause by a space.



    After starting the file «stdout.txt» (it is close to «sdlwav.exe»), or
    console output decoders are displayed and available quantity. For our
    configuration SDL_mixer get the following log:
    Before Mix_Init SDL_mixer supported: None
    After  Mix_Init SDL_mixer supported: FLAC MOD OGG 
    There are 5 available chunk(sample) decoders:
     WAVE
     AIFF
     VOC
     OGG
     FLAC
    There are 6 available music decoders:
     WAVE
     MIKMOD
     NATIVEMIDI
     OGG
     FLAC
     MP3
    Opened audio at 44100 Hz 16 bit stereo, 1024 bytes audio buffer
    Music type: MUS_MP3_MAD
    

    2.3.7. Compilation and installation of the library SDL_sound


    Description:
    Official site: http://icculus.org/SDL_sound/
    SDL_sound is an informal library extends the capabilities of SDL and allows you to use the
    functions of decoding and playback of popular audio file formats
    as «*.mp3», «*.wav» and others. It is designed to simplify writing
    applications. Is ananalog library SDL_mixer.

    Assembling:
    Attention! Dependencies:
    Library OGG
    Library OggVorbis (libVorbis)
    Library FLAC
    Library libmodplug
    Before compiling the library, compile and install all the dependencies!
    2.3.7.1. Download the latest stable version of the source code library SDL_sound,
    at the time of this writing, version 1.0.3:
    SDL_sound-1.0.3.tar.gz
    Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL_sound-1.0.3».
    2.3.7.3. Open the file «C:\Qt\build\SDL\SDL_sound-1.0.3\decoders\mpglib\mpg123_sdlsound.h»
    and replace the line #8:
    #include    <math.h>
    
    the following contents:
    # define M_PI       3.14159265358979323846
    # define M_SQRT2    1.41421356237309504880
    # define REAL_IS_FLOAT
    # define NEW_DCT9
    
    # define random rand
    # define srandom srand
    
    and then save the file.
    2.3.7.4. Open the file «C:\Qt\build\SDL\SDL_sound-1.0.3\decoders\timidity\tables.h»
    and comment the line # 23:
    //#include <math.h>
    
    then save the file.
    2.3.7.5. Compile and install the library SDL_sound:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type
    in the console window the following commands:
    export LIBS="-L/mingw/lib -lws2_32"
    cd /c/Qt/build/SDL/SDL_sound-1.0.3
    ./configure --prefix=/mingw
    make
    make install
    export -n LIBS
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.3.7.6. Compiled a static library and utilities, header files
    must be copied to the appropriate folders:
    utilities «playsound_simple.exe» and «playsound.exe» in «C:\Qt\MinGW\bin»
    static «libSDL_sound.a» and the rest in «C:\Qt\MinGW\lib»
    header «SDL_sound.h» in «C:\Qt\MinGW\include\SDL»
    2.3.7.7. The installation is complete. To verify the
    correctness of the library transfer any file containing music or sound in a
    format «*.mp3», «*.flac», «*.ogg», «*.wav» or «*.mod» onto
    executive binary «playsound. exe », which is located at«C:\ Qt\MinGW\bin»,
    and it shoud start play.

    Skip to content ↑

    2.3.8. Compilation and installation of the library SDL_draw


    Description:
    Official site: http://sdl-draw.sourceforge.net/ A small informal library to draw various graphics primitives.

    Assembling:
    2.3.8.1. Download the latest stable version of the source code
    library SDL_draw, at the time of this writing, the latest version 1.2.13:
    SDL_draw-1.2.13.tar.gz
    2.3.8.2. Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\SDL_draw-1.2.13».
    2.3.8.3. Compile and install the library SDL_draw:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and
    type in the console window the following commands:
    cd /c/Qt/build/SDL/SDL_draw-1.2.13
    ./configure --prefix=/mingw
    make
    make install
    cp /c/Qt/build/SDL/SDL_draw-1.2.13/include/SDL_draw.h /c/Qt/MinGW/include/SDL/SDL_draw.h
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.3.8.4. Compiled a static library, header files must be copied to the
    appropriate folders: static «libSDL_draw.a» in «C:\Qt\MinGW\lib»
    Header «SDL_draw.h» in «C:\Qt\MinGW\include\SDL»

    Skip to content ↑

    2.3.9. Compilation and installation of the library SDL_console


    Description:
    Official site: http://wacha.ch/wiki/sdlconsole
    SDL_Console implements the drop-down console, as in Quake, which can be easily added
    to any SDL-app. With the execution of commands in the console, you can easily manage
    your application. You can add more than one console at a time.

    Assembling:
    Attention! Dependencies:
    Library SDL_image
    Before compiling the library, compile and install all the dependencies!
    2.3.9.1. Download the latest stable version of the source code library SDL_console,
    at the time of this writing, the latest version 2.1: sdlconsole-2.1.tar.gz
    2.3.9.2. Extract the downloaded file to a folder «C:\Qt\build\SDL»,
    source libraries should be in the folder «C:\Qt\build\SDL\sdlconsole-2.1». 2.3.9.3. Compile and install the library SDL_console:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type in the console window the following commands:
    cd /c/Qt/build/SDL/sdlconsole-2.1
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.3.9.4. Compiled a static library, header files must be copied
    to the appropriate folders:
    static «libSDL_console.a» in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\SDL_console»

    Skip to content ↑

    2.4. Compile and install zlib library


    Description:
    Official site: http://zlib.net/
    zlib is a free cross-platform data compression library.
    It is used in a huge number of applications and libraries.
    Assembling:
    2.4.1. Download the latest stable version of the source code library
    zlib, at the time of this writing, version 1.2.7:
    zlib-1.2.7.tar.gz
    2.4.2. Extract the downloaded file to a folder «C:\Qt\build»,
    source libraries should be in the folder «C:\Qt\build\zlib-1.2.7».
    2.4.3. Open the file «C:\Qt\build\zlib-1.2.7\win32\Makefile.gcc»
    and the write in the line #32 as follows:
    SHARED_MODE=1
    
    Just change the "0" to "1".
    2.4.4. Compile and install zlib-library:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    export DESTDIR=/mingw && export BINARY_PATH=/bin && export INCLUDE_PATH=/include && export LIBRARY_PATH=/lib
    cd /c/Qt/build/zlib-1.2.7
    make -f win32/Makefile.gcc
    make install -f win32/Makefile.gcc
    export -n DESTDIR BINARY_PATH INCLUDE_PATH LIBRARY_PATH
    
    2.4.5. Compiled dynamic and static libraries, header files must be copied to
    the appropriate folders:
    shared library «zlib1.dll» in «C:\Qt\MinGW\bin»
    static «libz.a» and the rest in «C:\Qt\MinGW\lib»
    headers into «C:\Qt\MinGW\include»

    Skip to content ↑

    2.5. Compilation and installation of the JPEG library


    Description:
    Official site: http://www.ijg.org/
    The functions of the library libjpeg used by various programs and other libraries
    to work with the formats of mages «*.jpg», «*.jpeg» and others.
    Library is established by community «Independent JPEG Group».

    Assembling:
    2.5.1. Download the latest stable version of the source code library
    libjpeg, at the time of this writing, it's 9: jpegsrc.v9.tar.gz
    2.5.2. Extract the downloaded file to a folder «C:\Qt\build\Image»,
    source libraries should be in the folder «C:\Qt\build\Image\jpeg-9».
    2.5.3. Compile and install JPEG-library:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/Image/jpeg-9
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.5.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared library «libjpeg-9.dll» and binaries in «C:\Qt\MinGW\bin»
    static «libjpeg.a» and «libjpeg.dll.a» in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include»

    Skip to content ↑

    2.6. Compilation and installation of the PNG library


    Description:
    Official site: http://www.libpng.org/pub/png/libpng.html
    Library libpng - this is the official library for raster graphics format «*.png».
    The library is platform-independent and consists of a set of functions.
    Assembling:
    Attention! Dependencies:
    Zlib library
    Before compiling the library, compile and install all the dependencies!
    2.6.1. Download the latest stable version of the source code library libpng,
    at the time of this writing, the latest version 1.6.2: libpng-1.6.2.tar.gz
    2.6.2. Extract the downloaded file to a folder «C:\Qt\build\Image»,
    source libraries should be in the folder «C:\Qt\build\Image\libpng-1.6.2».
    2.6.3. Compile and install PNG-library:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type
    in the console window the following commands:
    cd /c/Qt/build/Image/libpng-1.6.2
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.6.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared library «libpng16-16.dll» and binaries in «C:\Qt\MinGW\bin»
    static «libpng.a» and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include»
    2.6.5. The installation is complete. If desired, you can compile the utility «pngtest.exe»:
    cd /c/Qt/build/Image/libpng-1.6.2
    gcc pngtest.c -o pngtest -lpng
    ./pngtest
    
    Its launch will give the testing results into the console of the
    file «pngtest.png», located in the folder «libpng-1.6.2».

    Skip to content ↑

    2.7. Compilation and installation of the TIFF library


    Description:
    Official site: http://www.remotesensing.org/libtiff/
    LibTIFF - is a set of libraries and utilities for viewing and editing
    images format «.tiff» or «*.tif».
    Established a computer company Silicon Graphics.
    Assembling:
    Attention! Dependencies:
    Zlib library
    JPEG library
    Before compiling the library, compile and install all the dependencies!
    2.7.1. Download the latest stable version of the source code library libtiff,
    at the time of this writing, version 4.0.3: tiff-4.0.3.tar.gz
    2.7.2. Extract the downloaded file to a folder «C:\Qt\build\Image»,
    source libraries should be in the folder «C:\Qt\build\Image\tiff-4.0.3».
    2.7.3. Compile and install TIFF-library:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu and type in
    the console window the following commands:
    cd /c/Qt/build/Image/tiff-4.0.3
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.7.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared libraries «libtiff-5.dll», «libtiffxx-5.dll»
    and binaries in «C:\Qt\MinGW\bin»
    static «libtiff.a» and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include»

    Skip to content ↑

    2.8. Compilation and installation of the library FreeType 2


    Description:
    Official site: http://www.freetype.org/
    FreeType 2 - library for raster fonts and operations on.
    Library greatly simplifies the operation
    of word processing and is used in many *nix-like systems.

    Assembling:
    Attention! Dependencies:
    Zlib library
    Before compiling the library, compile and install all the dependencies!
    2.8.1. Download the latest stable version of the source code
    library FreeType 2 at the time of this writing, the latest version 2.4.11:
    freetype-2.4.11.tar.gz
    2.8.2. Extract the downloaded file to a folder «C:\Qt\build»,
    source libraries should be in the folder «C:\Qt\uild\freetype-2.4.11».
    2.8.3. Compile and install the FreeType 2 library:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/freetype-2.4.11
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.8.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared library «libfreetype-6.dll» in«C:\Qt\MinGW\bin»
    static «libfreetype.a» and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\freetype2\freetype»

    Skip to content ↑

    2.9. Compiling and installing OGG library


    Description:
    Official site: http://xiph.org/ogg/
    OGG is a multimedia format, which is a container for native files and stream format
    for various multimedia codecs. OGG format is a stream-oriented.

    Assembling:
    2.9.1. Download the latest stable version of the source code OGG library,
    at the time of this writing, version 1.3.1:
    libogg-1.3.1.tar.gz
    2.9.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be in the folder «C:\Qt\build\Audio\libogg-1.3.1».
    2.9.3. Compile and install the library OGG:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/Audio/libogg-1.3.1
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.9.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared library «libogg-0.dll» in «C:\Qt\MinGW\bin» static «libogg.a» and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\ogg»

    Skip to content ↑

    2.10. Compiling and installing OggVorbis (libVorbis) library


    Description:
    Official site: http://www.vorbis.com
    OggVorbis is a new audio compression format.
    It is approximately comparable to other popular formats
    used to store and play digital music, such as MP3, VQF, AAC, and others.
    OggVorbis different from other formats because it is completely free, open
    source Vorbis codec and specifications are in the public domain.

    Assembling:
    Attention! Dependencies:
    Library OGG
    Before compiling the library, compile and install all the dependencies!
    2.10.1. Download the latest stable version of the source code library OggVorbis (libVorbis),
    at the time of this writing, version 1.3.3: libvorbis-1.3.3.tar.gz
    2.10.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be in the folder «C:\Qt\build\Audio\libvorbis-1.3.3».
    2.10.3. Compile and install the library OggVorbis (libVorbis):
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/Audio/libvorbis-1.3.3
    ./configure --prefix=/mingw
    make
    make install
    
    2.10.4. Compiled dynamic and static libraries, header files must be copied to the appropriate folders:
    shared Libraries «libvorbis-0.dll», «libvorbisfile-3.dll»
    and «libvorbisenc-2.dll» in «C:\Qt\MinGW\bin»
    static «libvorbis.a», «libvorbisenc.a», «libvorbisfile.a»
    and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\vorbis»

    Skip to content ↑

    2.11. Compilation and installation of the library FLAC


    Description:
    Official site:
    http://xiph.org/flac/
    FLAC stands for Free Lossless Audio Codec, an audio format that is similar to
    the format of MP3, but the compression it is lossless. It works like a ZIP, but with FLAC
    you will get much better compression because it was designed specifically for audio.
    From similar codec FLAC stands out in that it is not only the fastest, but not
    is a someone owners property, and therefore not encumbered by patents.
    Also, FLAC is an open source reference implementation of the well-documented format and API.
    Assembling:
    Attention! Dependencies:
    Library OGG
    Before compiling the library, compile and install all the dependencies!
    2.11.1. Download the latest stable version of the source code library FLAC,
    at the time of this writing, version 1.3.0: FLAC-1.3.0.tar.xz
    2.11.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be in the folder «C:\Qt\build\Audio\flac-1.3.0».
    2.11.3. Open the file «C:\Qt\build\Audio\flac-1.3.0\include\share\alloc.h»,
    add after line # 53 (# ifdef _MSC_VER) the following line:
    #   elif __MINGW32__
    
    after the addition save a file.
    2.11.4. Compile and install the library FLAC:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    export LIBS="-L/mingw/lib -lws2_32"
    cd /c/Qt/build/Audio/flac-1.3.0
    ./configure --disable-xmms-plugin --prefix=/mingw
    make
    make install
    export -n LIBS
    
    If you need any special parameters, e.g. «--enable-static=yes#187
    they can always be changed before configuring.
    The list of available options can be found by typing
    ./configure --help
    
    2.11.5. Compiled a static library, binary utilities, and header files
    must be copied to the appropriate folders:
    Executing binaries «flac.exe» and «metaflac.exe»
    and also «libFLAC-8.dll» with «libFLAC++-6.dll» in «C:\Qt\MinGW\bin»
    static libraries «libFLAC.dll.a» and «libFLAC++.dll.a» in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\FLAC» and «C:\Qt\MinGW\include\FLAC++»

    Skip to content ↑

    2.12. Compilation and installation of the library MikMod


    Description:
    Official site: http://mikmod.shlomifish.org/
    MikMod library is designed to work with tracker music.
    Written specifically for MS-DOS, player
    and library, were later ported to other platforms such as Unix, Macintosh, BeOS, and Java.
    Assembling:
    2.12.1. Download the latest stable version of the source code library MikMod,
    at the time of this writing, version 3.2.0:
    libmikmod-3.2.0.tar.gz
    2.12.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be in the folder «C:\Qt\build\Audio\libmikmod-3.2.0».
    2.12.3. Open the file «C:\Qt\build\Audio\libmikmod-3.2.0\drivers\drv_pipe.c»,
    add after the line # 33 the following line:
    #undef unix
    
    after the addition save the file.
    2.12.4. Open the file «C:\Qt\build\Audio\libmikmod-3.2.0\playercode\mdriver.c», add after the line # 27 the following line:
    #undef unix
    
    after the addition save the file.
    2.12.5. Compile and install the library MikMod:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    export CFLAGS="-march=native"
    cd /c/Qt/build/Audio/libmikmod-3.2.0
    ./configure --prefix=/mingw
    make
    make install
    export -n CFLAGS
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.12.6. Compiled a static library, header files
    must be copied to the ppropriate folders:
    the configuration «libmikmod-config» in «C:\Qt MinGW\bin»
    the static library «libmikmod.a» in «C:\Qt\MinGW\lib»
    header «mikmod.h» in «C:\Qt\MinGW\include»

    Skip to content ↑

    2.13. Compilation and installation of the library MAD (libmad)


    Description:
    Official site: http://www.underbit.com/products/mad
    MAD (libmad) is a high quality MPEG-audio decoder. Currently it supports MPEG-1 and MPEG-2
    format and MPEG 2.5. All three audio layers - Layer I, Layer II and Layer III
    (MP3) - decoder supports in full. MAD does not work with the MPEG-2 multichannel
    sound (although it should be compatible with the thread) and supports AAC.
    Assembling:
    2.13.1. Download the latest stable version of the source code library MAD (libmad),
    at the time of this writing, the latest version 0.15.1b: libmad-0.15.1b.tar.gz
    2.13.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be in the folder «C:\Qt\build\Audio\libmad-0.15.1b».
    2.13.3. Open the file «C:\Qt\build\Audio\libmad-0.15.1b\configure»
    plain text editor (I suggest using Notepad++ ) and find the line: # 19102:
    optimize="$optimize -fforce-mem"
    
    and remove it all with the translations. That is to become the # 19102 line:
    optimize="$optimize -fforce-addr"
    
    After modification, save the file.
    2.13.4. Compile and install the library MAD (libmad):
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/Audio/libmad-0.15.1b
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring. The list of
    available options can be found by typing
    ./configure --help
    
    2.13.5. Compiled a static library, header files must be copied to the
    appropriate folders:
    the static library «libmad.a» in «C:\Qt\MinGW\lib»
    header «mad.h» in «C:\Qt\MinGW\include»

    Skip to content ↑

    2.14. Compiling and installing OpenAL library


    Description:
    Official site: http://connect.creativelabs.com/openal/ OpenAL or Open Audio Library, is a free cross-platform API library for working with
    audio data. A key feature - working with sound in 3D space and the use of effects EAX.
    Library developed by Loki Software and is currently supported by Creative.
    Assembling:
    Attention! To compile the necessary CMake.
    2.14.1. Download the latest stable version of the source code library OpenAL,
    at the time of this writing, version 1.13:
    openal-soft-1.13.tbz2
    2.14.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be
    in the folder «C:\Qt\build\Audio\openal-soft-1.13».
    2.14.3. Compile and install the library OpenAL:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/Audio/openal-soft-1.13
    cmake -DCMAKE_INSTALL_PREFIX:PATH="/mingw" -DCMAKE_C_FLAGS:STRING="-march=i686" -G "MSYS Makefiles"
    make
    make install
    
    2.14.4. Compiled dynamic and static libraries, header files
    and utilities have to be copied to the appropriate folders:
    Install the project...
    -- Install configuration: "RelWithDebInfo"
    -- Installing: C:/Qt/MinGW/lib/libOpenAL32.dll.a
    -- Installing: C:/Qt/MinGW/bin/OpenAL32.dll
    -- Installing: C:/Qt/MinGW/include/AL/al.h
    -- Installing: C:/Qt/MinGW/include/AL/alc.h
    -- Installing: C:/Qt/MinGW/include/AL/alext.h
    -- Installing: C:/Qt/MinGW/include/AL/efx.h
    -- Installing: C:/Qt/MinGW/include/AL/efx-creative.h
    -- Installing: C:/Qt/MinGW/lib/pkgconfig/openal.pc
    -- Installing: C:/Qt/MinGW/bin/openal-info.exe
    

    Skip to content ↑

    2.15. Compilation and installation of the library ALUT (freealut)


    Description:
    Official site: http://connect.creativelabs.com/openal/
    Freealut is a free implementation of the standard OpenAL ALUT.
    Assembling:
    Attention! To compile it is the necessary CMake.
    Dependencies:
    OpenAL library
    Before compiling the library, compile and install all the dependencies!
    2.15.1. Download the latest stable version of the source code library ALUT (freealut),
    at the time of this writing, version 1.1.0: freealut-1.1.0.tar.gz
    2.15.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be in the folder «C:\Qt\build\Audio\freealut-1.1.0».
    2.15.3. Compile and install the library ALUT (freealut):
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/Audio/freealut-1.1.0
    cmake -DCMAKE_INSTALL_PREFIX:PATH="/mingw" -G "MSYS Makefiles"
    make
    make install
    
    2.15.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    Install the project...
    -- Install configuration: ""
    -- Installing: C:/Qt/MinGW/include/AL/alut.h
    -- Installing: C:/Qt/MinGW/lib/pkgconfig/freealut.pc
    -- Installing: C:/Qt/MinGW/bin/freealut-config
    -- Installing: C:/Qt/MinGW/lib/libalut.dll.a
    -- Installing: C:/Qt/MinGW/bin/libalut.dll
    
    2.15.5. Compile and run the demo code.
    2.15.5.1. Create a file «alutdemo.c» in the folder «C:\Qt\build\Audio», insert the following content:
    #include <stdlib.h>
    #include <AL/alut.h>
    
    int main (int argc, char **argv)
    {
      ALuint helloBuffer, helloSource;
      alutInit (&argc, argv);
      helloBuffer = alutCreateBufferHelloWorld();
      alGenSources(1, &helloSource);
      alSourcei(helloSource, AL_BUFFER, helloBuffer);
      alSourcePlay(helloSource);
      alutSleep(2);
      alutExit();
      return EXIT_SUCCESS;
    }
    
    and save.
    2.15.5.2. To compile the code, run the «C:\Qt\MinGW\msys\1.0\msys.bat»
    and type in the console window the following commands:
    cd /c/Qt/build/Audio
    gcc alutdemo.c -o alutdemo -lopenal32 -lalut
    ./alutdemo.exe
    
    These commands will compile the code into the executable file «alutdemo.exe»,
    when you start that you will hear the phrase «Hello, World!».

    Skip to content ↑

    2.16. Compiling and installing cURL (libcurl) library


    Description:
    Official site: http://curl.haxx.se/
    Library Libcurl - is an implementation of the API for the various programs
    that programmers can embed into their programs. cURL works as a
    standalone library wrapper for libcurl.
    Assembling:
    Attention! Dependencies:
    Zlib library (optionally. assembly is possible without it.)
    OpenSSL library (optionally. Need to build a library for cURL git)
    CMake (optionally. need to build a library for cURL git)
    Before compiling the library, compile and install all the dependencies!
    2.16.1. Download the latest stable version of the source code library cURL (libcurl),
    at the time of this writing, the latest version 7.30.0: curl-7.30.0.tar.gz
    2.16.2. Extract the downloaded file to a folder «C:\Qt\build»,
    source code library and utilities should be in the folder «C:\Qt\build\curl-7.30.0».
    2.16.3. Compile and install the library cURL:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/curl-7.30.0
    ./configure --prefix=/mingw
    make
    make install
    
    If the error occurred during configuration:
    checking run-time libs availability... failed
    configure: error: one or more libs available at link-time are not available run-time. Libs used at link-time: -lwldap32 -lws2_32  -lz
    
    Try to disable antivirus. Antivirus «Avira Free Antivir» did not like one of the
    test executive files created during configuration. So, the library is compiled
    with the default settings.If you need any special parameters, they can always
    be changed before configuring. The list of available options can be found by typing
    ./configure --help
    
    2.16.4. Assembling cURL library for git using CMake.
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/curl-7.30.0
    cp /mingw/lib/libwsock32.a /c/Qt/build/curl-7.30.0/lib/wsock32.lib
    cp /mingw/lib/libwldap32.a /c/Qt/build/curl-7.30.0/lib/wldap32.lib
    cp /mingw/lib/libws2_32.a /c/Qt/build/curl-7.30.0/lib/ws2_32.lib
    cp /mingw/lib/libwsock32.a /c/Qt/build/curl-7.30.0/src/wsock32.lib
    cp /mingw/lib/libwldap32.a /c/Qt/build/curl-7.30.0/src/wldap32.lib
    cp /mingw/lib/libws2_32.a /c/Qt/build/curl-7.30.0/src/ws2_32.lib
    cmake -DCMAKE_INSTALL_PREFIX:PATH="/mingw" -G "MSYS Makefiles"
    make 
    make install
    mv /mingw/lib/libcurl.dll /mingw/bin/libcurl.dll
    mv /mingw/lib/libcurl_imp.lib /mingw/lib/libcurl.a
    
    2.16.5. Compiled dynamic and static libraries, header files and utilities
    have to be copied into the appropriate folders:
    utility «curl.exe», dynamic library «libcurl-4.dll» or «libcurl.dll»,
    if used CMake in «C:\Qt\MinGW\bin»
    static «libcurl.a» and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\curl»

    Skip to content ↑

    2.17. Compilation and installation of the library libmodplug


    Description:
    Official site: http://modplug-xmms.sourceforge.net/
    libmodplug library is designed to work with tracker music. Is an analog library MikMod.
    Assembling:
    2.17.1.Download the latest stable version of the source code library libmodplug,
    at the time of this writing, version 0.8.8.4: libmodplug-0.8.8.4.tar.gz
    2.17.2. Extract the downloaded file to a folder «C:\Qt\build\Audio»,
    source code library and utilities should be in the folder "C:\Qt\Build\Audio\libmodplug-0.8.8.4".
    2.17.3. Compile and install the library libmodplug:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/Audio/libmodplug-0.8.8.4
    ./configure --prefix=/mingw
    make
    make install
    
    2.17.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared library «libmodplug-1.dll» in «C:\Qt\MinGW\bin»
    static «libmodplug.dll.a» and the rest in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\libmodplug»

    Skip to content ↑

    2.18. Compile and install OpenSSL libraries and utilities


    Description:
    Official website: http://www.openssl.org/
    OpenSSL - cryptographic package (utilities + library) open source to work with SSL/TLS.
    Allows you to create different types of keys RSA, DH, DSA and certificates X.509, sign
    them, generate a CSR and CRT. Furthermore it is possible to encrypt data
    and to test SSL/TLS connection.

    Assembling:
    2.18.1. Download the latest stable version of the source code library OpenSSL,
    at the time of this writing, the latest version 1.0.1c: openssl-1.0.1c.tar.gz
    2.18.2. Extract the downloaded file to a folder «C:\Qt\build»,
    source code library and utilities should be in the folder "C:\Qt\Build\openssl-1.0.1c".
    2.18.3. Compile and install the library OpenSSL:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/openssl-1.0.1c
    ./Configure mingw --prefix=/mingw
    make
    make install
    
    Compiling OpenSSL and its installation, it is enough long-term process.
    2.18.4. Compiled dynamic and static libraries, header files and utilities
    have to be copied into the appropriate folders:
    utility «openssl.exe» in «C:\Qt\MinGW\bin»
    static «libssl.a» and «libcrypto.a» in «C:\Qt\MinGW\lib»
    headers in «C:\Qt\MinGW\include\openssl»

    Skip to content ↑

    2.19. Compilation and installation of the library Expat


    Description:
    Official site: http://expat.sourceforge.net/
    Expat - it's a free stream-oriented library for parsing XML. One of the most
    accessible XML parsers are widely used in open-source software.
    Assembling:
    2.19.1. Download the latest stable version of the source code library Expat,
    at the time of this writing, version 2.1.0: Expat-2.1.0.tar.gz
    2.19.2. Extract the downloaded file to a folder «C:\Qt\build»,
    source code library and utilities should be in the folder "C:\Qt\Build\Expat-2.1.0".
    2.19.3. Compile and install the library Expat:
    Run «C:\Qt\MinGW\msys\1.0\msys.bat» or ConEmu
    and type in the console window the following commands:
    cd /c/Qt/build/expat-2.1.0
    ./configure --prefix=/mingw
    make
    make install
    
    Library is compiled with the default settings. If you need any special
    parameters, they can always be changed before configuring.
    The list of available options can be found by typing
    ./configure --help
    
    2.19.4. Compiled dynamic and static libraries, header files
    must be copied to the appropriate folders:
    shared Library «libexpat-1.dll» in «C:\Qt\MinGW\bin»
    static «libexpat.a» and the rest in «C:\Qt\MinGW\lib »
    headers in «C:\Qt\MinGW\include»

    Skip to content↑

    3. MinGW integration with IDE


    Develop applications using the console shell, that not all familiar, and we need to
    go with the times. Therefore, together with our collected toolchain I recommend
    using a development environment QtCreator. It will also allow you to develop desktop
    applications using the powerful framework Qt.
    In QtCreator there and code completion, and adjustable backlight, there
    is even emulation vim, if you're really so accustomed to it.
    Appearance QtCreator (clickable image) :



    Installation is extremely simple:
    1.Need to load the assembly Qt libraries for MinGW (at the time of this writing the latest version 4.8.4): [DOWNLOAD].
    2. Install the library in «C:\Qt\qt-4.8.4», the installer will ask the path to the compiler should indicate «C:\Qt\MinGW», if the installer ask for to heder, do not worry, you can continue.
    3.Download the proper himself QtCreator (at the time of this writing the latest version, 2.7.1): [DOWNLOAD].
    4. Install QtCreator in «C:\Qt\qtcreator-2.7.1».
    5.Environment is ready to write programs! By the way, except for convenient qmake, has built-in support for CMake, of course, provided that we have installed this cmake.
    6. Updates can be found here.

    Skip to content↑

    QT library allows you quickly create cross-platform GUI applications,
    but criticized for the high consumption of resources and the large size
    of created applications. So alternative way of MinGW integration with IDE
    will be tool chain Code::Blocks with wxWidgets. How to? Tell about it in my next post

    1 comment:

    Anonymous said...

    All of this information was very helpful. Thank you!