Artifact 15d2e06ec9e076c4c5276405b1d8c2bac891504299c999508770c7b3ea75a4cd:

Wiki page [Configuration] by luismachuca 2019-02-03 16:49:20.
D 2019-02-03T16:49:20.715
L Configuration
P 600aa7ea17a2fc67728ec08c4f564e68c9fae4a003eb8c498c6932c7ab0da365
U luismachuca
W 3715
<h1>General configuration procedure</h1>

  #  Take a look at the [Per-Compiler Notes] for your specific compiler.
  #  Add the <i>cxxomfort/</i> path to your compiler/project's <code>#include</code> path.

<h2>
<h2>Configuring GCC</h2>

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

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

<b>In C++03 mode only:</b>

Add to the compiler search path the path to the TR1 forwarder <b>before</b> the path to cxxomfort. See [Per-Compiler Notes#notes-gcc] for more information.

<b>Alternative: Patching system headers [note: unsupported]</b>

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 <code>stl_list.h</code> 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: <em>(link pending)</em>: 

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

Of note however, trying this is <b>NOT</b> recommended and not supported.

<h2>Configuring with clang</h2>

Use the <code>-I</code> switch to add to the compiler path:

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

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 <b>GCC 4.6 or earlier</b> (<small>more specifically, to deal with the declarations of some of the new <code>cmath</code> functions</small>). 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 <tt>stdlib</tt> Standard Library implementation; libc++ (eg.: "<tt>clang-libc++</tt>) is not supported.

<h2>Configuring with MSVC</h2>

Use the <code>-I</code> switch to add to the compiler path:

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

<b>stdint.h and inttypes.h</b>

If your version of MSVC comes without <tt><stdint.h></tt> and or <tt><inttypes.h></tt>(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 [http://softwareramblings.com/2008/03/c-tr1-stdinth-still-missing-from-visual-studio.html|here] or [https://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio|here].
  *  Download the "portable stdint.h" described [http://softwareramblings.com/2008/03/c-tr1-stdinth-still-missing-from-visual-studio.html|here] (<code>pstdint.h</code>) and save it as stdint.h.
  *  Copy the version of pstdint.h already included in cxxomfort (under <code>cxxomfort/impl/pstdint.h</code>). 

<b>MSVC 2008</b>

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


<hr/>

  *  ← Back to [Installation].
  *  → Continue to [Features].

Z 14b5d6fcf0f0760aa445a821599a38e1