Table Of Contentwww.it-ebooks.info
Instant MinGW Starter
Develop, debug and profile your C++ applications using
the MinGW open source software
Ilya Shpigor
BIRMINGHAM - MUMBAI
www.it-ebooks.info
Instant MinGW Starter
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher,
except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged to be caused directly or
indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies
and products mentioned in this book by the appropriate use of capitals. However, Packt
Publishing cannot guarantee the accuracy of this information.
First published: January 2013
Production Reference: 1210113
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84969-562-6
www.packtpub.com
www.it-ebooks.info
Credits
Author Project Coordinator
Ilya Shpigor Amigya Khurana
Reviewer Proofreader
Kyle Schwarz Maria Gould
Acquisition Editor Production Coordinator
Edward Gordon Prachali Bhiwandkar
Commissioning Editor Cover Work
Maria D'souza Prachali Bhiwandkar
Technical Editor Cover Image
Ankita Meshram Conidon Miranda
www.it-ebooks.info
www.it-ebooks.info
Foreword
"Yoda's aphorism ("There is no 'try'") sounds neat, but it doesn't work for me. I have
done most of my work while anxious about whether I could do the job, and ensure
that it would be enough to achieve the goal if I did. But I tried anyway, because
there was no one but me between the enemy and my city. Surprising myself, I have
sometimes succeeded."
Richard Matthew Stallman,
Launcher of the GNU Project and founder of the Free Software Foundation
Sometimes it seems that the world is limited to just the Microsoft Windows operating system
and that the developing of complex applications is impossible without the latest version of MS
Visual Studio. But there are open houses where there is no need to look at the sky through the
windows. There are a lot of development environments that are different from commonly used
ones, and this variety allows us to feel the world of the software in its entirety.
PCs are losing their significance increasingly and are yielding the personal computing device's
role to tablet computers and smartphones. The world does not consist of only one hardware
architecture nowadays. The different CPU architectures and operating systems for supporting
them are available now. The ability to develop cross-platform applications is important too.
Many software development tools have been created as a part of the GNU Project since
1984 when the project started. The GNU compiler collection is a part of these software
development tools.
Minimalist GNU for Windows (MinGW) is a software port of the GNU Toolchain for Microsoft
Windows operating system. Its minimalism means that MinGW doesn't provide the whole
POSIX compatible environment. In the meantime it doesn't yield to its ancestor for Unix-based
systems but allows you to feel Unix philosophy.
www.it-ebooks.info
MinGW allows open source software developers to port their software to the Windows operating
system. MinGW software with any of the well-known cross-platform framework integration
allows you to develop cross-platform applications even if you don't care about this feature. This
feature provides a great competitive advantage if your customer decides to change his or her
computing platform to another suddenly. You don't need a special Linux version or additional
developer team in this case. Just make minor changes in your software and that's all you need.
The MinGW software allows you to use plenty of open source C and C++ libraries that integrate
with MinGW well. You can develop applications with more features and reuse source code thanks
to these libraries. Often open source libraries' licenses allow you to choose if your application will
be a free software or a proprietary one.
The world of command-line interface, Makefiles, and build systems can be very enthralling
like other new things. Compiling your program with new tools always leads to surprises.
It finds faults in places with seemingly clean code. Try to calm it down.
You do not get lost. You can integrate MinGW software with an integrated development
environment (IDE), such as Code::Blocks, Qt Creator, and even Eclipse if you will tolerate
Eclipse's slowness.
Good luck! And don't forget to use a control version system for your source code. The frequent
commits are a pledge of quick bugs searching that has been added to the developed source code
with any new feature or code correction.
This book allows you to quickly start new software project development thanks to detailed
explanation on how to create a necessary development environment. You will know how to
download necessary tools, choose user interface library and compile applications. At first,
it is important to understand where to start. I believe that this book will dispel your doubts
and you will understand that these things are actually simple.
Try it!
Vitaly Lipatov
CEO, Etersoft
www.it-ebooks.info
About the Author
Ilya Shpigor is a software developer in a flight simulator manufacturing company in Saint
Petersburg, Russia. His work is in developing real-time computing systems that work under
heavy computational loads. Ilya prefers to use open source software products, such as the
Linux operating system and GNU toolchain, for his daily tasks.
He has participated in ALT Linux distribution and Wine open source software development
before his current job.
Ilya has experience in cross-platform software development, porting applications to other
computing platforms, and real-time computing systems design. He is interested in automating
routine tasks and researching the capacities of different programming languages to solve
specific problems.
Writing a book is the hard work of many people and not just that of the
author. I would like to thank everyone who has helped me with this work.
I would like to gratefully acknowledge Navin Mehra, an Author Relationship
Executive, who found me and suggested I write this book. It is difficult to
overestimate the importance of this event for the book.
I would like to thank the Commissioning Editor, Maria D'souza, who corrected
my drafts so many times.
I would like to thank the technical reviewer, Kyle Schwarz. His comments were
very helpful to improve this book significantly.
And a special thanks to my mentor and friend, Vitaly Lipatov, who introduced
me to the wonderful world of open source software.
www.it-ebooks.info
About the Reviewer
Kyle Schwarz has been working on Linux machines for over 7 years and has a deep
understanding of low-level system functions. He is a detail-oriented individual, who has
experience in many aspects of computer software and hardware. He enjoys working with
all technology platforms and is constantly expanding his experience in this field.
He has worked for several major companies on projects that involved FFmpeg, Windows
BATCH scripting, Linux BASH scripting, web development, web design, Windows Installer
scripting, and much more. He currently operates zeranoe.com and does contract work for
companies and individuals.
I would like to thank my Dad for teaching me the value of hard work. His
guidance and leadership have been the most valuable aspects of my life.
www.it-ebooks.info
www.packtpub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to
your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub
files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book
customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@
packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
www.it-ebooks.info
Description:"Yoda's aphorism ("There is no 'try'") sounds neat, but it doesn't work for me. I have done most of . Boost, Qt, GTK, OpenGL, and SDL. If you are using