C++ CreateThread() strange error
<p>I try to use CreateThread() function in my application, but I get strange error, exactly:</p>

<pre><code>error: invalid conversion from 'DWORD (__ attribute__((__ stdcall__)) *)() {aka long unsigned int (__ attribute__((__ stdcall__)) *)()}' to 'LPTHREAD_START_ROUTINE {aka long unsigned int (__ attribute__((__ stdcall__)) *)(void*)}' [-fpermissive]
</code></pre>

<p>and</p>

<pre><code>In file included from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/windows.h:50:0,

             from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winsock2.h:22,
             from c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/ws2tcpip.h:19,
             from include/WinSockClass.hpp:3,
             from C:\Users\Jakub\Desktop\offline\Server\main.cpp:15:
c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include/winbase.h:1423:26: error:   initializing argument 3 of 'void* CreateThread(LPSECURITY_ATTRIBUTES, DWORD, LPTHREAD_START_ROUTINE, PVOID, DWORD, PDWORD)' [-fpermissive]
</code></pre>

<p>second indicates line</p>

<pre><code>WINBASEAPI HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,PVOID,DWORD,PDWORD);
</code></pre>

<p>in winbase.h, I don't understand what going on, in examples is same thing, but without error. What I do wrong ?</p>

<p>code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;windows.h&gt;

using namespace std;

int a()
{
   cout &lt;&lt; "work";
   return 0;
}
int main(int argc, char **argv)
{
    CreateThread(NULL,0,a,NULL,0,NULL);
    return 0;
}
</code></pre>