Error using pthread on Windows with Mingw

前端 未结 2 1062
慢半拍i
慢半拍i 2021-01-25 21:53

I\'m trying to use threads on a Windows C program, compiled on an Eclipse environment and Mingw.

I\'ve also put -lpthread and -pthread on the compilation command, and in

相关标签:
2条回答
  • 2021-01-25 22:13

    "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."

    To solve this have look on this.

    Or

    When abort() function is getting called from your application you will see that error.

    From MSDN:

    abort

    Aborts the current process and returns an error code.

    void abort( void ); Return Value

    abort does not return control to the calling process. By default, it terminates the current process and returns an exit code of 3.

    Remarks

    By default, the abort routine prints the message:

    "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."

    But in your case you need to find why abort() is getting called .

    0 讨论(0)
  • 2021-01-25 22:19

    Solved!

    AFAIK there is no portable pthread library for Windows under Mingw.

    I solved my problem using CreateThread(), and let Mingw resolves it using Windows native threads.

    0 讨论(0)
提交回复
热议问题