Game Engine Architecture

(Ben Green) #1
69

The Solution Explorer is a tree view. The solution itself is at the root, with
the projects as its immediate children. Source fi les and headers are shown as
children of each project. A project can contain any number of user-defi ned
folders, nested to any depth. Folders are for organizational purposes only and
have nothing to do with the folder structure in which the fi les may reside
on-disk. However it is common practice to mimic the on-disk folder structure
when sett ing up a project’s folders.


2.2.4. Build Confi gurations


The C/C++ preprocessor, compiler, and linker off er a wide variety of options
to control how your code will be built. These options are normally specifi ed
on the command line when the compiler is run. For example, a typical com-
mand to build a single translation unit with the Microsoft compiler might look
like this:


C:\> cl /c foo.cpp /Fo foo.obj /Wall /Od /Zi

This tells the compiler/linker to compile but not link (/c) the translation unit
named foo.cpp, output the result to an object fi le named foo.obj (/Fo foo.obj),
turn on all warnings (/Wall), turn off all optimizations (/Od), and generate
debugging information (/Zi).
Modern compilers provide so many options that it would be impracti-
cal and error prone to specify all of them every time you build your code.
That’s where build confi gurations come in. A build confi guration is really just
a collection of preprocessor, compiler, and linker options associated with a
particular project in your solution. You can defi ne any number of build con-


2.2. Microsoft Visual Studio


Figure 2.9. The VisualStudio Solution Explorer window.

Free download pdf