General configuration procedure

  1. Take a look at the Per-Compiler Notes for your specific compiler.
  2. Add the cxxomfort/ path to your compiler/project's #include path.

Configuring GCC

To add the path to a compile command, use the -I or -isystem switches:

g++ [...options] -I /path/to/include/cxxomfort/ [...sources]

In C++03 mode only:

Add to the compiler search path the path to the TR1 forwarder before the path to cxxomfort. See Per-Compiler Notes#notes-gcc for more information.

Alternative: Patching system headers note: unsupported

If one does not wish to add further dependencies to the project, and due to the way the TR1 headers are themselves coded, the fallback to skirt around the issue is to make sure that code that uses the ambiguous symbols (in stl_list.h among others) is somehow made to see only the base implementation required and not the TR1 one.

There are two ways around this issue detailed in the following issue: (link pending):

  • patch stl_list.h and other such files to refer to the namespace or object by full name, or...
  • Make sure that the system headers affected such as <list> are #included into the project before cxxomfort/cxxomfort.hpp - or before any other cxxomfort header except the ones described in "Base Features", that is cxxomfort/base.hpp and a few others.

Of note however, trying this is NOT recommended and not supported.

Configuring with clang

Use the -I switch to add to the compiler path:

clang [...options] -I /path/to/include/cxxomfort/ [...sources]

For the most part this will be setup and work exactly as it does in GCC; however, it might be necessary to patch a couple of header files from the tr1/ implementation if using clang alongside GCC 4.6 or earlier (more specifically, to deal with the declarations of some of the new cmath functions). Patching the libraries or providing other fallbacks falls outside the scope of this document.

As of latest 2018 release, Clang is only supported with the stdlib Standard Library implementation; libc++ (eg.: "clang-libc++) is not supported.

Configuring with MSVC

Use the -I switch to add to the compiler path:

cl.exe [...options] -I /path/to/include/cxxomfort/ [...sources]

stdint.h and inttypes.h

If your version of MSVC comes without <stdint.h> and or <inttypes.h>(such as the Express version of MSVC 2008), you can simply download them from somewhere and add their path to the compiler/project's search paths.

  • Copy one of the various alternative stdint.h sources like the ones described here or here.
  • Download the "portable stdint.h" described here (pstdint.h) and save it as stdint.h.
  • Copy the version of pstdint.h already included in cxxomfort (under cxxomfort/impl/pstdint.h).

MSVC 2008

Depending on the version of MSVC 2008 being used, support given by cxxomfort is conditioned. See Per-Compiler Notes#notes-msvc for more information.