The first step is to download ClanLib and all its dependency libraries. Get the latest source version of ClanLib.
You will need to setup a sane build environment. This involves two things:
My personal build environment is setup as follows using c:\Development\Environment as base path:
Note: You don't need to follow the same scheme, put your libraries where it fits you.
Here is how it looks like after I've installed Zlib (from the precompiled binaries download or if you built zlib from source):
To add the paths to Visual Studio:
When you initially download a ClanLib source package, it will not contain the ClanLib project files, but rather a Configuration Wizard called configure.exe.
You have to run this wizard and answer its questions carefully. Incorrect information will give you problems during the compilation.
When the configure wizard asks me where to install the header and library files, I specify those paths from section 2: C:\Development\Environment\include and C:\Development\Environment\lib.
When this is done, open the ClanLib.sln solution file.
After loading the ClanLib solution, the project view will show many different projects; clanApp, clanCore, clanDisplay, etc.
Start with making clanCore the active project, if its not active already. You do this by right-clicking it, and select 'Set as Active Project'. Select Debug or Release in the toolbar. If you can't find this option anywhere, right click on the toolbar, and make sure Build is selected, and deselect the Build Minibar. Press F7 to compile the active project.
You need to compile at least these projects:
Optionally, you can compile the others if you need them. Menu item Build->Batch Build is handy here.
Each library in ClanLib can be built in multiple different versions, x86 or x64, debug or release, static or as a DLL and so on. The version is reflected in the library name:
The ClanLib headers automatically detect which version is to be used. This is done by looking at defines set by Visual Studio. For example, the define _DEBUG is set by the compiler when you build debug versions of your application, which causes the ClanLib/core.h header to issue a #pragma comment(lib, "clanCore-static-mt-debug.lib") statement, which makes the linker automatically link with that specific version of the library.
After a successful compilation of ClanLib, it will automatically run a batch file that will install all headers and lib files in the path you specified in the wizard. In my case, that is c:\Development\Environment\lib and c:\Development\Environment\include. So the following files will be added:
To create a Visual Studio solution file for your project, read the Visual C++ on Windows guide.