Cinder

Creating a Windows Project

The TinderBox tool which comes with Cinder is the easiest way to create new projects, and in general we recommend you use that. However it can be instructive to know how to create a Cinder project from scratch, which is discussed in the section below.

TinderBox

TinderBox is our GUI tool for creating Cinder projects quickly and easily. It can generate Xcode as well as Visual C++ 2008 and 2010 projects. It is located at cinder/tools/TinderBox in our packaged releases. The first time you launch it, TinderBox will ask you to point it at the location of Cinder on your hard drive.

TinderBox welcome

Navigate to the top level Cinder directory and hit Choose. If you ever need to change this later, you can do so from the preferences menu.

TinderBox Cinder Location

There are a number of settings in TinderBox, but the defaults will suffice for most users. Simply hit the Create button, and you'll have a complete Cinder project ready for you to start coding in.

TinderBox Settings
TinderBox Results

Creating Projects from Scratch

Creating a Windows project from scratch in Cinder is not too difficult. Visual C++ offers tremendous flexibility in how users can structure their projects, and this guide will show you how to setup a project similarly to the samples. However Cinder is designed to be flexible and you should feel free to adapt things to your preferences.


Let's start in Windows Explorer. We'll create a folder for our project, and inside that a folder for source code called src.


Now open up Visual C++, and from the File menu select New Project. In the dialog box, select Win32 Project from the Win32 category.

New Project in VC

Tell Visual C++ to save the project in the project folder we created earlier. In the following options dialog box, make sure to specify creating an empty project.

Save new project

At this point we would recommend closing your project in Visual C++, and then locating your project in the Explorer. Rename the folder named after your project (and housing your.vcproj) to vc9. This is certainly optional, but can simplify the eventual possibility of your project accomodating other compilers or operating systems.

New Project in Finder

Now open your project back up in Visual C++. We'll create our first .cpp file by right-clicking on the Source folder and selecting Add | New Item... Specify the destination as the src folder we created earlier.

New C++ File

For the purposes of this guide, we'll just copy and paste the code from cinder/samples/basicApp/src/basicApp.cpp as a starting point for this project.


At this point if you were to try to build your project, you'll get a number of compile errors due to Visual C++ not being able to find Cinder, so let's point it at the right places for finding its headers and libraries. Under the Project menu, select Properties. Go to the Build tab and in the Configuration popup in the window's upper left corner, select All Configurations. Under the C/C++ section select the General category. Now modify the Additional Include Directories and set it to be <path to cinder>\include; <path to cinder>\boost

Compile Settings

You'll need to modify the following settings in a similar fashion.

Category Setting Value
All Configurations:
C/C++ | General
Additional Include Directories <path to Cinder>\include;<path to Cinder>\boost
All Configurations:
Linker | General
Additional Library Directories <path to Cinder>\lib;<path to Cinder>\lib\msw
Debug:
Linker | Input
Additional Dependencies cinder_d.lib
Release:
Linker | Input
Additional Dependencies cinder.lib
Debug:
C/C++ | Code Generation
Runtime Library Multi-threaded Debug (/MTd)
Release:
C/C++ | Code Generation
Runtime Library Multi-threaded (/MT)
All Configurations:
Linker | Advanced
Data Execution Prevention (DEP) Image is not compatible with DEP (/NXCOMPAT:NO)