Organization
Two milestones were met today, things that had to be done even though they weren’t written on my 50+ item to-do list for this project.
First, I organized my code finally. The compiled executables land in the folders wd_msw and vc_msw for wxDev-C++ and Visual C++ 2005 Express beta respectively.
+---doc
+---images
+---include
+---src
+---tests
+---vc_msw
| \---residue
+---wd_msw
| \---obj
\---wxg
My new folder structure supports using the same sources for both wxDev-C++ and Microsoft VC++ 2005 Express. Both compilers and environments use the same source and include folders, despite their vastly different project file format.
Secondly, I finally got my source code to compile on the Microsoft VC++ 2005 Express beta product. The usual suggestion is to copy an existing sample and change the configuration from the GUI. I did in fact use an exising sample as a starting point, but I was having very little luck getting it to compile, plus I was trying to match the paths to my shiny new code organization folder structure, something VC++ Express was loathe to permit. The only thing that worked was opening up that sample vcproj in a text editor and cutting through the project file (flashcard.vcproj) like a madman. The build options are vastly easier to edit in a text editor than in VC++ Express itself.
I blew away all the Configurations except for Release|Win32, and likewise for FileConfigurations. This will undoubtably limit some functionality, it is much easier to edit a 150 line file than to deal with a jillion different build options. I intend to develop in wx-Devcpp and do the final releases in VC++ Express. I compiled wxWidgets 2.6.2 in release mode so I have to do the same for my application.
After removing the sample files from the project and adding the real ones, VC++ Express listed the source files outside of the Source Files list and VC++ compiler was complaining it couldn’t find the header files. I carefully closed VC++ Express and reopened the vcproj file in the text editor and sure enough, the File elements were not inside the Filter element named “Source Files.” So I promptly copied and pasted the text to fix that problem, and suddenly VC++ Express compiled my program into a shiny new executable.
Microsoft says the ProjectGUID property is used by .NET apps, which I don’t care about currently, so I didn’t take care to make it unique.
I found nothing of value in the sample’s solution (.sln) file. This gets created automatically, so it is not needed.
Bottom line is that the mingw compiler (currently required by wxDev-C++) produces a 6 meg executable and the Microsoft one produces a 2 meg executable. For this reason it was worth the effort.
This is what my Visual C++ Express project file looks like:
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="flashcard"
ProjectGUID="{9111E5D3-29DD-4A71-98AA-A820A318CA99}"
RootNamespace="flashcard"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="."
IntermediateDirectory=".\residue"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,__WXMSW__,_WINDOWS,NOPCH"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\residue/flashcard.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/EHsc "
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="$(WXWIN)\include,$(WXWIN)\lib\vc_lib\msw,.,$(WXWIN)\samples,..\include"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
PrecompiledHeaderFile=".\residue/flashcard.pch"
AssemblerListingLocation=".\residue/"
ObjectFile=".\residue/"
ProgramDataBaseFileName=".\residue\flashcard.pdb"
WarningLevel="4"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="__WXMSW__,_WINDOWS,NOPCH"
Culture="1033"
AdditionalIncludeDirectories="$(WXWIN)\include,$(WXWIN)\lib\vc_lib\msw,.,$(WXWIN)\samples"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wxmsw26_core.lib wxmsw26_adv.lib wxmsw26_xrc.lib wxmsw26_html.lib wxbase26.lib wxbase26_xml.lib wxexpat.lib wxpng.lib wxjpeg.lib wxtiff.lib wxzlib.lib wxregex.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib odbc32.lib"
OutputFile=".\CardGriLa.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="$(WXWIN)\lib\vc_lib"
ProgramDatabaseFile=".\residue/cardgrila.pdb"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\residue/cardgrila.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
>
<File
RelativePath="..\src\flashcard-res.cpp"
>
</File>
<File
RelativePath="..\src\frmLearn.cpp"
>
</File>
<File
RelativePath="..\src\main.cpp"
>
</File>
<File
RelativePath="..\src\ryanssplit.cpp"
>
</File>
<File
RelativePath="..\src\tcard.cpp"
>
</File>
<File
RelativePath="..\src\tcardlist.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
