First step is to make sure your Visual Studio system is up to date. As of this writing, we support the following versions:
You also need to install the Windows 8 SDK. Note that this already comes with Visual Studio 2012.
If you need the very latest ClanLib directly from our source control repository, read the compilation guide.
Otherwise and much easier, you can just use the precompiled versions we provide, these are always up-to-date on the latest release. Read on for a guide on using the precompiled libraries.
The precompiled versions can be found here: Visual Studio Binaries.
After you downloaded the binaries, exctract these files into a directory. Remember which one, because you need to enter that information in the next section. It will create a structure looking like this:
You will need to configure Visual Studio to look for the downloaded libraries.
Follow these steps to create a Visual Studio solution for a ClanLib application:
Select File->New Project.
Find Visual C++ group in the Project Types, and select Win32 Project, and specify the location, and click OK.
Under Application Settings, select Empty project, and press Finish.
Add a new C++ file to your project. This can be done by right clicking your project in Solution Explorer, and selecting Add->New Item->C++ File.
If you do not do this first, you will not see the C++ / Code Generation settings required for step 7.
Right click your Project (not the solution) and select Properties.
Select the Configuration Properties section.
Select the C/C++ tab, and then category Code Generation.
Change the Use run-time library to Debug Multithreaded.
Change the configuration dropdown at the top of the dialog to Release.
Change the Use run-time library to Multithreaded.
That should be it. If you've done everything correct, you can start coding your ClanLib application!
You could also check out the examples that comes with the distribution; they are a great resource to learn from. Since the precompiled packages does not include the examples, you will need to download the ClanLib source package. Download the ClanLib source package, extract it anywhere, and open the Examples.sln Visual Studio solution file.
The most common problems encountered with building ClanLib applications: