Showing posts with label Windows/x86. Show all posts
Showing posts with label Windows/x86. Show all posts

Sunday, September 13, 2009

New Software Development Process, Part 2 - Installing the Compiler Tools

In my next set of blog entries, I will describe the steps I took to install the tools for the new software development process. The first set of tools that I installed are my compiler tools.

I already have Microsoft Visual Studio 2005. For those of you who want to employ the same software development process and don't have Microsoft Visual Studio 2005, you can download a free copy of Microsoft Visual C++ 2008 Express Edition at:
http://www.microsoft.com/express/vc/

These steps are the ones I took to install the GCC MinGW compiler tools on our Windows/x86 platform. Be aware that I chose to use the 2-step installation process:

1) download the software
2) install the software

In the most common installation process, downloading and installing the software is done in one (1) step.

I chose to the 2-step process because I was installing the software on more than one machine. The 2-step process allows me to download the software once for all the machines instead of once for each machine.


First, I created the top-level folder
C:\SWDevTools


Then, I created the second-level folder
C:\SWDevTools\MinGW


I created the sub-folder
C:\SWDevTools\MinGW\download


I created the second-level folder
C:\SWDevTools\MSys


I created the sub-folder
C:\SWDevTools\MSys\download


Using my web browser (Mozilla Firefox), I went to
http://sourceforge.net/projects/mingw/files/

I scrolled down to the item called "Automated MinGW Installer" which has the sub-item "MinGW 5.1.6".


I clicked the sub-item "MinGW 5.1.6" to reveal the sub-items "MinGW-5.1.6.exe"
and "MinGW-5.1.6.exe-src.tar.lzma"

I downloaded MinGW-5.1.6.exe (installer app) to
C:\SWDevTools\MinGW\download

I went back to
http://sourceforge.net/projects/mingw/files/

I scrolled farther down to the item called "MSYS Base System" and clicked on it to reveal the several sub-items. I clicked on the sub-item "Current Release_MSYS-1.0.11" to reveal several sub-items.

I downloaded MSYS-1.0.11.exe to
C:\SWDevTools\MSys\download


I scanned the file "MinGW-5.1.6.exe" for viruses and then executed it.

Select "Download only"
Select "Current" MinGW package

Select the following components to download:

MinGW base tools
g++ compiler
Java Compiler
Objective C Compiler
MinGW Make


I scanned the downloaded files for viruses and then copied them to each PC, that I want to install the development environment, using the same directory structure

C:\SWDevTools\MinGW\download

On each PC, I execute MinGW-5.1.6.exe, again.

Select "Download and install"
Select "Current" MinGW package

Select the following components to download:

MinGW base tools
g++ compiler
Java Compiler
Objective C Compiler
MinGW Make

Specify the following "Destination Folder"

C:\SWDevTools\MinGW


After installing MinGW, I set the environment variable

MINGW

to

C:\SWDevTools\MinGW


Then, I added, to the environment variable, "path", the following:

C:\SWDevTools\MinGW\bin

To test the installation of MinGW, I built the following "Hello World" program using the MinGW C++ compiler.

#include
int main ( int argc , char* argv [] ) {
int inputkey ;
printf ( "Hello World!\n\n" ) ;
printf ( "" ) ;
inputkey = getchar () ;
return 0 ;
} ;

I use the following commands to create the source file.

mkdir C:\SWDevTools\MinGW\test

notepad C:\SWDevTools\MinGW\test\HelloWorld.cpp


I use the following command to build the executable. (all on one line)

g++ C:\SWDevTools\MinGW\test\HelloWorld.cpp -oC:\SWDevTools\MinGW\test\HelloWorld.exe

Double clicking on HelloWorld.exe results in the following output:

Hello World!




MinGW was installed successfully.


New Software Development Process, Part 1 - Introduction, What, and Why



Today, we start developing software using a new development process. In the past, we've maintained, for each application, multiple code bases, one for each target platform. With the new development process, we will maintain, for each application, only one code base, one for all target platforms.

To do so, we will use one set of cross-platform open source software development tools.

For diagramming our application architecture and data structure, we will use Inkscape.

We will use one common set of compiling/linking tools on all our platforms. We will use the tools in the GNU Compiler Collection (GCC). On the Windows/x86 platform, we will use the MinGW version of the GCC tools.

All operating system calls will be made through an abstraction layer composed of a set of c++ header (.h) files that define macros and inline functions with common names across all platforms.

We will also abandon the use of native application frameworks like Microsoft Foundation Class (MFC) and Apple's Cocoa for Mac OS X. Instead, we will use wxWidgets, the cross-platform application framework.

We will use wxFormBuilder to design the graphic user interface (GUI) for our applications.

For rendering graphics, we will abandon use of native graphics APIs like Microsoft DirectX and, instead, use OpenGL, the cross-platform graphics engine.

For accessing data in client/server relational database management systems (RDBMSs), we will use the Open Database Connectivity (ODBC) API. If the customer does not specify a particular RDBMS, we will use MySql.

For simple local databases, we will use SQLite.

There is one exception to the use of open source cross-platform tools. Because all of us are already familiar with Microsoft Visual Studio 2005, we will use it to write and debug our applications on the Windows/x86 platform. Once the debugging is complete, we will build the final product using the GCC compilers on the target platforms (including the Windows/x86 platform).

Here is our software development process:

1) On the Windows/x86 platform, create a project folder for the new application.

2) Create a sub-folder named "Design" for containing the design documents.

3) Design and diagram the application's architecture and data structure using Inkscape and save the diagrams in the "Design" subfolder.

4) Create a sub-folder named "Forms" for containing the design for the application's GUI.

5) Design the application's GUI using wxFormBuilder and save the output in the "Forms" sub-folder.

6) Use wxFormBuilder to generate C++ source code for application's interface with wxWidgets and save them into the "Forms" sub-folder.

7) Copy the wxFormBuilder generated the source code to the top-level project folder.

8) Create the Microsoft Visual Studio project files for the new application in the top-level project folder and set up the newly created project for building a wxWidgets application.

9) Add the WxFormBuilder generated the source code to the newly created Microsoft Visual Studio project.

10) Edit/Build/Debug the code for the new application.

11) When the Microsoft Visual Studio generated executable code works, build the application using the GCC MinGW compiler.

12) When the GCC MinGW generated executable code works on the Windows platform, build the application using the GCC compiler on the target platforms.

We will build applications for the following platforms:

Windows/x86
Linux/x86
Linux/PowerPC
MacOS/x86
MacOS/PowerPC