Friday, December 08, 2006

Compile and Build Maze Client

These days, I am continuously working on modifying, compiling and building maze client. Because there is no document and some additional packages are used, it is difficult to build successfully from souce code.
I downloaded a Entriprise Trial edition(C++ Builder 6.0) from website of Borland company. During the installation of C++ Builder, I selected all optional packages in case some of them are needed later.
After installation of C++ Builder:
1) ShellControls package must be installed.
This package is not installed as standard package when C++ builder is installed.
This package is located at "CB_DIR/Examples/ShellControls"(CB_DIR is the directory where you install C++ Builder to). There are two packages in this directory: bcbshlctrls.bpk and dclshlctrls.bpk. Package bcbshlctrls.bpk should be opened in C++ Builder and compiled. Package dclshlctrls.bpk should be opened in C++ Builder, compiled and installed.
(dclshlctrls.bpk is a design time package)

2) I think the project file of maze is destroyed and I must modify it manually.
In maze project, shellctrls.obj is needed. However, in project file, there is no statement to indicate compile how to build shellctrls.obj. So, I add several directives to tell C++ Builder how to build shellctrl.obj.
In section <OBJFILES> , I added "cbdebug\ShellCtrls.obj"
In section <FILELIST>, I added <FILE FILENAME="ShellCtrls.cpp" FORMNAME="" UNITNAME="ShellCtrls.cpp" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND="">

3) If compile errors occur, for example, some macros in ShellCtrls.cpp are not defined...:
then you should add a macro definition in this file.
"#define NO_WIN32_LEAN_AND_MEAN" should be added to ShellCtrls.cpp.
Note!!! this definition must be put at the beginning of the file. If you put it otherwhere, strange errors may occur!!(Lots of time was consumed when I debugged it here).

4) To make sure everything is OK, I put all source files including some provided by C++ Builder needed into project directory. Those files provided by C++ Builder are shellconsts.h, ShellCtrls.h, ShellCtrls.cpp.

No comments: