title: use c++ method in c program
body: <p>I want to use C++ library gloox in my C code (easycwmp package for openwrt).</p>
  
  <p>I compile with openwrt toolschain the gloox as package: </p>
  
  <p>here is the cpp file gloox.cpp :</p>
  
  <pre><code>#include "gloox.h" 
  namespace gloox 
  {
    const std::string XMPP_STREAM_VERSION_MAJOR = "1";
    const std::string XMPP_STREAM_VERSION_MINOR = "0";
    const std::string GLOOX_VERSION           = "1.0.11";
    const std::string GLOOX_CAPS_NODE         = "http://camaya.net/gloox";
  }
  extern "C" const char* gloox_version()
  {
    return gloox::GLOOX_VERSION.c_str();
  }
  </code></pre>
  
  <p>the header file gloox.h : </p>
  
  <pre><code>#ifndef GLOOX_H__
  #define GLOOX_H__
  
  #include "macros.h"
  
  
  extern "C" //--&gt; error: expected identifier or '(' before string constant 
  {
    GLOOX_API const char* gloox_version();
  }
  
  #endif // GLOOX_H__
  </code></pre>
  
  <p>the compilation of gloox package is OK 
  when I include gloox.h in my C code of easycwmp package I get this error :</p>
  
  <p>staging_dir/target-i386_uClibc-0.9.33.2/usr/include/gloox.h:12:8: error: expected identifier or '(' before string constant !!</p>
  
  <p>I compile libgloox with command :</p>
  
  <pre><code>make package/libgloox/compile 
  </code></pre>
  
  <p>and then I compile easycwmp package with cmd :</p>
  
  <pre><code>make package/easycwmp/compile 
  </code></pre>
  
  <p>Any help is appreciated  </p>