On Tue, May 7, 2019 at 12:17 AM David Mathog <mat...@caltech.edu> wrote:
>
> On 04-May-2019 20:31, Liu Hao wrote:
> > 在 2019/5/4 上午6:16, David Mathog 写道:
>
> Thanks for the feedback, but I'm still nowhere near getting this to
> work.
>
> >>
> >> Issues:
> >>
> >>
> >> 1.  Compiler warnings:
> >>
> >> c_spawn_n.c: In function 'main':
> >> c_spawn_n.c:47:13: warning: passing argument 3 of 'CreateThread' from
> >> incompatible pointer type [-Wincompatible-pointer-types]
> >>              RunCommand,             // thread function name
> >>              ^~~~~~~~~~
> >
> > `LPTHREAD_START_ROUTINE` is the type of the parameter of
> > `CreateThread()`, which a pointer-to-function. The proper return type
> > for a thread procedure is `DWORD` rather than this thing.
>
> Changed the called routine to (see below):
>
> DWORD  RunCommand(  void *lpParam  ){

try :

DWORD WINAPI Runcommand(LPVOID lpParam) { ...}

see https://docs.microsoft.com/en-us/windows/desktop/procthread/creating-threads

Vincent Torri


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to