
Compiling issues with Guiface
-----------------------------

Guiface uses an open source code from a project called "Expat" for XML
parsing routines.  The project home page is at http://expat.sourceforge.net.
For Windows, Expat can be downloaded as a DLL Visual C++ 6.0 project.  I
use modified version of the project that uses a static library that would
be linked to the executable, in order to diminish the need for distribution
of an extra DLL.  Read below to see how to make a static library based on
the existing VC++ project.

In one of the guiface files there is an include statement that includes
expat.h, an API header file for the library.  On Windows, make sure that the
project settings allow the compiler to see the directory where the expat.h
header file is.  To set it, use the C/C++ tab, category "Preprocessor", text
box "Additional include directories".


Linking issues with Guiface on Windows
--------------------------------------

To link properly, you need to add wsock32.lib under C/C++ tab, category
"Input", text box "Object/Library modules", needed for the sockets stuff.
At C/C++ tab, go to "Code Generation" category and choose Multithreaded OR
Debug Multithreaded under the "Use run-time library" drop-down box, depending
on whether it is for "Win32 Release" config settings, or for "Win32 Debug".
Debug Multithreaded would, obviously, be useful for debugging.  Also, read
the next section to learn how to use expat.


How to use Expat with Guiface on Windows
----------------------------------------

Well, this is a REALLY dirty hack to make it work.  I hope this description
is detailed enough.

The hack was done using expat version 1.95.2.  First, Download the DLL expat
Visual C++ 6.0 workspace.  Create a new Win32 Static Library project, and name
it, for example, expat_static.  Then add ALL files that are in expat project
to expat_static in the same manner.  Don't worry about "External Dependency"
files.

Then open the config settings for the expat project, make sure that settings
for "All configurations" is set, and go to C/C++ tab, category "Preprocessor",
copy the whole text under "Preprocessor definitions", and paste them in the
equivilent text box under expat_static project replacing the old contents,
with having "All configurations" selected as well.  Then in the same text box
("Preprocessor definitions") append (add at the end)
-->,VERSION="\"unknown\""<-- (text between the arrows).

Next, also under C/C++ project tab, go to "Code Generation" category  and
choose Multithreaded OR Debug Multithreaded under the "Use run-time library"
drop-down box, depending on whether it is for "Win32 Release" config settings,
or for "Win32 Debug".  Debug Multithreaded would, obviously, be useful for
debugging.

Then go ahead and compile.  Debug/Release directory down from where the
expat_static project file is saved should hold the .lib file you need to link
with in you guiface projects.

To link with expat_static.lib, under the Link tab, category Input, the text box
"Additional Library Path" should have a directory that points to where the
compiled .lib file exists.  At "Object/Library modules" text box on the same
page add expat_static.lib at the end.  Again, set "All configurations" to set
for all configs.

Immediately BEFORE you include expat.h in a guiface project file, make sure you
always put this code:
  #ifdef _MSC_EXTENSIONS
  #	undef _MSC_EXTENSIONS
  #endif
And, I don't know what the hell _MSC_EXTENSIONS is.

You may need to get rid of (comment out or whatever) DllMain() function from
expat.

Now it should all compile and link.
