title: calling even a simple c function in c# produces System.AccessViolationException
body: <p>so I have got the following functions written in C:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #define Dll   __declspec( dllexport )
  
  int main() 
  {
      return 0;
  }
  
  Dll void printHelp() 
  {
      printf("Halcyon compiler help:\n");
      printf("   -compile [File] - Compiles file to executable\n");
      printf("   -convert [File] - Converts file to IL. File's will be written down here\n");
      printf("   -result [Text] - how does given line look in IL\n");
      return;
  }
  
  Dll void printInfoHelp() 
  {
      printf("-info\n");
      printf("   classes - Prints all classes\n");
      printf("   elements - Prints currently loaded elements\n");
      printf("   version - Prints current version of SlashButter\n");
      return;
  }
  </code></pre>
  
  <p>And this is my C# code importing the functions:</p>
  
  <pre><code>[DllImport(@"Utils.dll", CallingConvention = CallingConvention.Cdecl)]
  public static extern void printHelp();
  [DllImport(@"Utils.dll", CallingConvention = CallingConvention.Cdecl)]
  public static extern void printInfoHelp();
  </code></pre>
  
  <p>However when I call <code>printHelp()</code> or <code>printInfoHelp()</code> I get <code>System.AccessViolationExcepion</code>. I have looked up many similar questions here on Stackoverflow, but none seemed to help me. I am compiling x86, visual studio hosting process disabled, unsafe code allowed, <code>CallingConvention</code> added, but still it is to no avail.
  Is there something I am doing wrong? It is really frustrating.</p>
  
  <p>Thanks in advance for any replies.</p>
  
  <p>EDIT: I accidentally didn't paste the whole file here. Added the #include lines.</p>