title: How to avoid multiple definition of PANTHEIOS_FE_PROCESS_IDENTITY?
body: <p>I'm working on a project with multiple files and I need logging in each of it.</p>
  
  <p>In order to compile a file I need the following:</p>
  
  <pre><code>/* Define the stock front-end process identity, so that it links when using
   * fe.N, fe.simple, etc. */
  PANTHEIOS_EXTERN_C const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PSTR("fileX.cpp");
  </code></pre>
  
  <p>Let's say, I have log1.cpp and log2.cpp and log.h common to both files. These files get compiled to log1.o and log2.o. That works just fine.</p>
  
  <p>Now, when I link these two files into one executable, I get the following error:</p>
  
  <pre><code>log2.o:(.rodata+0x11): multiple definition of `PANTHEIOS_FE_PROCESS_IDENTITY'
  log1.o:(.rodata+0x45): first defined here
  </code></pre>
  
  <p>Now the problem is, that PANTHEIOS_FE_PROCESS_IDENTITY needs to be defined in both file1.cpp and file2.cpp in order to compile.</p>
  
  <p>How do I need to change my code in order to be able to link it into an executable?</p>
  
  <p>Here are the files used:
  log1.cpp:</p>
  
  <pre><code>#include "log.h"
  
  const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PSTR("log1.cpp");
  
  int main()
  {
    PANTHEIOS_TRACE_NOTICE(PSTR("a string at NOTICE level"));
    return 0;
  }
  </code></pre>
  
  <p>log2.cpp:</p>
  
  <pre><code>#include "log.h"
  const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PSTR("log1.cpp");
  </code></pre>
  
  <p>log.h:</p>
  
  <pre><code>#ifndef LOG_H
  #define LOG_H
  
  /* Pantheios Header Files */
  #include &lt;pantheios/pantheios.h&gt;                // Pantheios C main header
  #ifndef STLSOFT_CF_SUPPORTS_VARIADIC_MACROS
  # error This example uses the Tracing API, which requires that the compiler support variadic macros
  #endif /* !STLSOFT_CF_SUPPORTS_VARIADIC_MACROS */
  #ifdef STLSOFT_CF_FUNCTION_SYMBOL_SUPPORT
  # include &lt;string&gt;
  # define PANTHEIOS_TRACE_PREFIX     \
      (   std::basic_string&lt; PANTHEIOS_NS_QUAL(pan_char_t)&gt;(__FILE__ " " PANTHEIOS_STRINGIZE(__LINE__) ": ") + \
          __FUNCTION__ + \
          "(): " \
      ).c_str()
  #endif /* STLSOFT_CF_FUNCTION_SYMBOL_SUPPORT */
  #include &lt;pantheios/trace.h&gt;                    // Pantheios Trace API
  #include &lt;pantheios/pantheios.hpp&gt;              // Pantheios C++ main header
  
  /* Standard C/C++ Header Files */
  #include &lt;exception&gt;                            // for std::exception
  #include &lt;new&gt;                                  // for std::bad_alloc
  #include &lt;string&gt;                               // for std::string
  #include &lt;stdlib.h&gt;                             // for exit codes
  
  #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  # if defined(STLSOFT_COMPILER_IS_MSVC)
  #  pragma warning(disable : 4702)
  # endif /* compiler */
  #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  
  #define PSTR(x)         PANTHEIOS_LITERAL_STRING(x)
  
  #include "pantheios/frontends/fe.simple.h" //for pantheios_fe_simple_setSeverityCeiling(level);
  
  #endif //LOG_H
  </code></pre>
  
  <p>And the output of make:</p>
  
  <pre><code>g++ log1.cpp -c -I../pantheios-1.0.1-beta213/include -I../stlsoft-1.9.112/include
  g++ log2.cpp -c -I../pantheios-1.0.1-beta213/include -I../stlsoft-1.9.112/include
  g++ -o log log1.o log2.o -L../pantheios-1.0.1-beta213/lib \
          -lpantheios.1.core.gcc44\
          -lpantheios.1.be.fprintf.gcc44 -lpantheios.1.bec.fprintf.gcc44\
          -lpantheios.1.fe.simple.gcc44 -lpantheios.1.util.gcc44
  log2.o:(.rodata+0x0): multiple definition of `PANTHEIOS_FE_PROCESS_IDENTITY'
  log1.o:(.rodata+0x1): first defined here
  /usr/bin/ld: Warning: size of symbol `PANTHEIOS_FE_PROCESS_IDENTITY' changed from 14 in log1.o to 9 in log2.o
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Edit: in pantheios-1.0.1-beta213/include/pantheios/frontends/stock.h:120 ‘PANTHEIOS_FE_PROCESS_IDENTITY’ is declared as extern, so I cannot redefine it as static.</p>