title: How to fix ''Expected ';' after top level declarator" and "Unknown type name 'class'?
body: <p>I use cocoa to import TUIKit which is a imSDK demo written in objective-c by Tencent into my blank swift app. I get the error:  Expected ';' after top level declarator and Unknown type name 'class'; did you mean 'Class'?</p>
  
  <p>The file whith the error is wav.h and there is wav.mm file. Here is the code:</p>
  
  <p>File wav.h</p>
  
  <pre><code>#ifndef WAV_H
  #define WAV_H
  #include &lt;stdio.h&gt;
  class WavWriter {
  public:
      WavWriter(const char *filename, int sampleRate, int bitsPerSample, int channels);
      ~WavWriter();
      void writeData(const unsigned char* data, int length);
  private:
      void writeString(const char *str);
      void writeInt32(int value);
      void writeInt16(int value);
      void writeHeader(int length);
      FILE *wav;
      int dataLength;
      int sampleRate;
      int bitsPerSample;
      int channels;
  };
  #endif
  </code></pre>
  
  <p>The error is on the line "class WavWriter".</p>
  
  <p>The wav.mm file</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #include "wav.h"
  void WavWriter::writeString(const char *str) {
  
      fputc(str[0], wav);
      fputc(str[1], wav);
      fputc(str[2], wav);
      fputc(str[3], wav);
  }
  </code></pre>
  
  <p>....</p>
  
  <p>I searched for two days and couldn't find the answer. Any help? Thanks.</p>