![]() |
[Main] | [News] | [Publications] | [Downloads] | [Documents] | [Contacts] |
|
In this document, we will explain how to build Xface Toolkit code.
Currently, we are using Visual C++ 7.1 (.Net 2003 version), however any ANSI compliant C++ compiler should be able to compile Xface. We will add relevant information for other platforms, especially for gcc, in the near future when we successfully port and test Xface on other platforms. If you are using Visual C++ 6.0 version, I have some bad news for you, you cannot build Xface, since the compiler does not support some standard C++ features that we use in the code*. I really recommend you to upgrade to a newer version. Some people recently reported having troubles with VC++ 2005, but I don't know the details, please let me know if you succeed building with VC++ 2005.
In order to compile Xface successfully you need to first have following libraries compiled. Note that all libraries are open source, platform independent and widely known in the open source community. This list may change in the future, so please check back here first, when you want to upgrade to a newer Xface version.
Boost is a great library, it is more or less everything you need and you don't have in STL, and can be used as an extension to STL. It is huge and complicated, but for the moment Xface only uses shared_ptr for the smart pointer implementation. Use of Boost is strongly recommended to any serious C++ developer. Building Boost might be tricky for the people who are new to programming but there is enough explanation on their website. For starting, check this link, it might seem complicated at first, but if you follow the steps it's pretty much a straightforward process.
SDL is currently used for sound playback and timer functionality but will be totally removed from the dependencies in the near future. It is NOT used by the core library, so if you want to build only the core library (which is quite unlikely), you can ignore this library. You don't need to build SDL, you just have to download the developer binaries (.h, .lib and .dll files) and set your compiler folders accordingly (as explained below).
Xface currently
links to SDL 1.2.7 version.
Xerces library is
used for XML processing. You don't need to compile the library by yourself. Just
download and extract it to your HD. Do not forget to set MSVC folders
accordingly (as explained below).
Xface currently links to Xerces-C 2.7 version.
Before starting the build process, you should modify setup.h file. The reasons and details are explained in the above link. You should at least set wxUSE_GLCANVAS to 1 in order to have OpenGL support. You can see and modify other options as well, but the rest of the options are not so crucial for Xface. I use the binary library (not the dll version) and I suggest you to do the same.
In the new version, they have slightly changed their
system for simpler linkage (I guess). You should edit setup file (the one in
C:\...\wxWidgets-2.6.2\lib\vc_lib\msw\wx\setup.h) and add GL library support by
adding the lines:
#pragma comment(lib,"wxmsw26_gl")
and
#pragma comment(lib,"wxmsw26d_gl")
in appropriate places (non unicode version, ifdefs for debug and release..).
Xface currently links to wxWidgets 2.6.2 version, and soon to 2.7.
MS SAPI 5.1 SDK:
With the new version, Xface relies on MS SAPI 5.1 for text to speech synthesis.
You should download and install SAPI 5.1 SDK.
OpenGL Extensions:
Xface uses some OpenGL extensions for rendering. You have to download glext.h
file from the above link and put it into the folder where your standard gl.h
file exists. Normally in your compiler folder, under all includes, there is a
GL folder for that.
Once you build/install all the libraries, you should set Visual C++ folders, so that these libraries are visible to the compiler/linker. Follow these steps for MSVC++ 7.1 .NET;
from the Tools menu, choose Options, a dialog will appear.
from the left menu, choose Projects, choose VC++ Directories
At the top-right there is a combo box with title Show Directories for:, first choose Include Files
Now you should add the include folders for the libraries above to this list. All the libraries have a specific include folder and you should point to that folder explicitly. Here is my list as an example:
C:\Work\DevLibs\wxWidgets-2.6.2\include
C:\Work\DevLibs\wxWidgets-2.6.2\include\msvc
C:\Work\DevLibs\Boost\include\boost-1_33
C:\Work\DevLibs\xerces-c_2_7_0-windows_nt-msvc_60\include
C:\Work\DevLibs\SDL\SDL-1.2.7\include
Then you should repeat the same for Library Files similarly, pointing to lib folders.
You should also add Xface core library's include folder and XSmilAgent as well.
C:\Work\Xface\trunk\XFace\include
C:\Work\Xface\trunk\XSmilAgent
wxFaceEd.sln file found under wxFaceEd source folder is used as the main solution file for Xface Toolkit. You can open this file in MSVC .NET and build the solution.
See http://xface.blogspot.com/2004/11/compiling-xface.html
for discussion.
* VC++ 6.0 users: You can try to find a workaround for problems with your compiler and I will be happy to upload your version to our source tree.