title: How to create C++ package using Swift Package Manager?
body: <p>I'm following this blog to make a C++ package using SPM:
  <a href="http://ankit.im/swift/2016/05/21/creating-objc-cpp-packages-with-swift-package-manager/" rel="nofollow noreferrer">http://ankit.im/swift/2016/05/21/creating-objc-cpp-packages-with-swift-package-manager/</a></p>
  
  <p>But am getting this error when building:</p>
  
  <pre><code>swift build
  'SwiftCpp' /home/karthik/Swift_programs/SwiftCpp: error: target at '/home/karthik/Swift_programs/SwiftCpp/Sources' contains mixed language source files; feature not supported
  </code></pre>
  
  <p>I'm using Swift version 4.2.3 on Ubuntu 18.04 LTS.</p>
  
  <p>Here's the code :</p>
  
  <p>main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "cpplib.h"
  
  int main() {
      std::cout &lt;&lt; cpplib::five();
      return 0;
  }
  </code></pre>
  
  <p>cpplib.cpp</p>
  
  <pre><code>#include "include/cpplib.h"
  
  namespace cpplib {
    int five(){
      return 5;
    }
  }
  </code></pre>
  
  <p>cpplib.h</p>
  
  <pre><code>namespace cpplib{
    int five();
  }
  </code></pre>
  
  <p>cwrapper.cpp</p>
  
  <pre><code>#include "include/cwrapper.h"
  #include "cpplib.h"
  
  int cwrapperfive(){
    return cpplib::five();
  }
  </code></pre>
  
  <p>cwrapper.h</p>
  
  <pre><code>#ifdef __cplusplus
  extern "C"  {
  #endif
  
  int cwrapperfive();
  
  #ifdef __cplusplus
  }
  #endif
  </code></pre>
  
  <p>main.swift</p>
  
  <pre><code>import cwrapper
  print(cwrapperfive())
  </code></pre>
  
  <p>How can I solve this?</p>