Wednesday, September 16, 2009

New Software Development Process, Part 5 - Verifying the Installation of wxWidgets

To test the installation of wxWidgets, I built the "Hello World" program, from wxWidgets web site, using the Visual Studio 2005 and the MinGW C++ compiler.

I created the subfolder
C:\SWDevTools\wxWidgets\test

I point my web browser to the URL
http://www.wxwidgets.org/docs/tutorials/hworld.txt

I copied the source code from this web page and paste it to
C:\SWDevTools\wxWidgets\test\hworld.cpp

I executed Visual Studio 2005 and created a new project.

In the "New Project" dialog, I specified the project to be a Win32 project.

I specified the "Name" of the project to be
test

I specified the "Location" to be
C:\SWDevTools\wxWidgets

I unchecked the "Create directory for solution" option.

Then, I clicked the "Ok" button.

When the W32 Application Wizard" dialog appeared, I clicked the "Next >" button.

For Application Settings", I specified the "Application type" to be
Windows application

I specified for the "Additional options"
Empty project

Then, I clicked the "Finish" button.


I clicked the "Project" menu item, from Visual Studio's top menu bar, to obtain its drop down menu.

From the "Project" drop down menu, I clicked the "Add Existing Item..." menu item.

When the "Add Existing Item" dialog for specifying the item to be added popped up, I selected
C:\SWDevTools\wxWidgets\test\hworld.cpp


I clicked the "Project" menu item, from Visual Studio's top menu bar, to obtain its drop down menu.

From the "Project" drop down menu, I clicked the "test Properties..." menu item.

I selected the "Configuration Properties" "General" tree item.

For the both the "Debug" and "Release" configurations' "Character Set", I specified
"Not Set"


I selected the "Configuration Properties" "C/C++" "General" tree item.

For the "Debug" configuration's "Additional Include Directories" I specified
$(SolutionDir),$(WXWIN)\include,$(WXWIN)\contrib\include,$(WXWIN)\lib\vc_lib\mswd

For the "Release" configuration's "Additional Include Directories" I specified
$(SolutionDir),$(WXWIN)\include,$(WXWIN)\contrib\include,$(WXWIN)\lib\vc_lib\msw


I selected the "Configuration Properties" "C/C++" "Preprocessor" tree item.

For the "Debug" configuration's "Preprocessor Definitions" I specified
WIN32;_DEBUG;_WINDOWS;__WINDOWS__;__WXMSW__;__WXDEBUG__;WXDEBUG=1;__WIN95__;__WIN32__;WINVER=0x0400;STRICT

For the "Release" configuration's "Preprocessor Definitions" I specified
WIN32;NDEBUG;_WINDOWS;__WINDOWS__;__WXMSW__;__WIN95__;__WIN32__;WINVER=0x0400;STRICT


I selected the "Configuration Properties" "Linker" "General" tree item.

For both the "Debug" and "Release" configurations' "Additional Library Directories" I specified
$(WXWIN)\lib\vc_lib


I selected the "Configuration Properties" "Linker" "Input" tree item.

For the "Debug" configuration's "Additional Dependencies" I specified
comctl32.lib rpcrt4.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib

For the "Release" configuration's "Additional Dependencies" I specified
comctl32.lib rpcrt4.lib wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib


At this point, I clicked the "OK" button on the "Property Pages" dialog.


Next, I clicked the "File" menu item, from Visual Studio's top menu bar, to obtain its drop down menu.

From the "File" drop down menu, I clicked the "Save All" menu item.


To generate the debug (default) build of the application, I clicked the "Build" menu item, from Visual Studio's top menu bar, to obtain its drop down menu.

From the "Build" drop down menu, I clicked the "Build Solution" menu item.


To generate the release build of the application, I clicked the "Build" menu item, from Visual Studio's top menu bar, to obtain its drop down menu.

From the "Build" drop down menu, I clicked the "Build Configuration Manager..." menu item and specify the "Active Solution Configuration" to be "Release" and close the dialog.

Then, I clicked the "Build" menu item, from Visual Studio's top menu bar, to obtain its drop down menu.

From the "Build" drop down menu, I clicked the "Build Solution" menu item.


I found, in both the folders

C:\SWDevTools\wxWidgets\test\Debug

and

C:\SWDevTools\wxWidgets\test\Release

the file test.exe

I ran both the test.exe in the "Debug" and in the "Release" folders to verify that the "Hello World" applications work.

Yeah! Both work.


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

g++ -Wall -mwindows hworld.cpp -I%WXWIN%\include -I%WXWIN%\contrib\include -I%WXWIN%\lib\gcc_lib\msw %WXWIN%\lib\gcc_lib\libwxmsw28_core.a %WXWIN%\lib\gcc_lib\libwxbase28.a %WXWIN%\lib\gcc_lib\libwxtiff.a %WXWIN%\lib\gcc_lib\libwxjpeg.a %WXWIN%\lib\gcc_lib\libwxpng.a %WXWIN%\lib\gcc_lib\libwxzlib.a %WXWIN%\lib\gcc_lib\libwxregex.a %WXWIN%\lib\gcc_lib\libwxexpat.a %WXWIN%\lib\gcc_lib\libwxexpat.a %MINGW%\lib\libkernel32.a %MINGW%\lib\libuser32.a %MINGW%\lib\libgdi32.a %MINGW%\lib\libwinspool.a %MINGW%\lib\libcomdlg32.a %MINGW%\lib\libadvapi32.a %MINGW%\lib\libshell32.a %MINGW%\lib\libole32.a %MINGW%\lib\liboleaut32.a %MINGW%\lib\libuuid.a %MINGW%\lib\libcomctl32.a -otest.exe 2>test.lis

I ran the test.exe in

C:\SWDevTools\wxWidgets\test

to verify that the "Hello World" applications work.


Yeah! It works.

No comments: