Setting up on Windows
Before We Begin
This tutorial assumes that you are developing a C or C++ application. If you want to use Awesomium with .NET or C#, then you'll need to follow our AwesomiumSharp tutorial instead.
Checklist
You will need the following:
- The latest Awesomium v1.6 SDK for Windows (download it here)
- Microsoft Visual C++ 2008 (aka MSVC9)**
**Note: You can use MSVC10 with Awesomium if you use our C API-- see "Using the C API" below
Install the SDK
After downloading the SDK, unzip the ZIP file to some convenient location.
Folder Structure of the SDK
The SDK should contain two folders in the installation directory: build and include.
- build/bin folder: Contains DLLs that you will need to bundle with your application
- build/lib folder: Contains static libraries that you will need to link against your application.
- include folder: Contains headers that you will need to #include in your source files to access the Awesomium API
Set up your project
Configure project settings
- Create a new project in MSVC (the Empty Project template is recommended).
- Add your C++ source files.
- Right-click your project name, select Properties to open up the Property Pages dialog.
- Add the path to the SDK's include folder to Additional Include Directories (should be under Configuration Properties -> C/C++ -> General) for both Debug and Release configurations.
- Add the paths to the SDK's lib directories
(e.g.,
build/lib/debugandbuild/lib/release) to Additional Library Directories (should be under Configuration Properties -> Linker -> General) for both Debug and Release configurations, respectively. - Add Awesomium_d.lib to Additional Dependencies (should be under Configuration Properties -> Linker -> Input) for the Debug configuration.
- Add Awesomium.lib to Additional Dependencies for the Release configuration.
Copy files to your build distribution
Before running your executable, make sure to copy the
entire contents of the SDK's
build/bin/release and build/bin/debug/
directories to your respective Debug and
Release build directories. You will need to bundle
these files (icudt42.dll,
AwesomiumProcess.exe, locales folder, and
Awesomium.dll) with your executable.
Include the API
To include the entire API for Awesomium in your source files, you simply need to include WebCore.h:
#include <Awesomium/WebCore.h>
Using the C API
If you wish to use our ANSI C API instead (which allows
interoperability with other MSVC builds and the option to use the
Release build of our library with both of your project's
configurations), you will need to include
awesomium_capi.h:
#include <Awesomium/awesomium_capi.h>