Morn icon indicating copy to clipboard operation
Morn copied to clipboard

Windows 11系统中 src/ptc/morn_coroutine.c 文件编译失败

Open Polaris1123 opened this issue 1 year ago • 1 comments

我在Windows11使用make编译时出现报错信息:

D:\software\Morn>make -f msvc_makefile
cl.exe -O2 -nologo -openmp -I ./include -I C:/ProgramFiles/CPack/include -c src/ptc/morn_coroutine.c -Fo"src/ptc/morn_coroutine.obj"
morn_coroutine.c
src/ptc/morn_coroutine.c(50): error C2480: “handle”:“thread”只对静态作用域的数据项有效
make: *** [msvc_makefile:78: src/ptc/morn_coroutine.obj] Error 2

我使用的make版本是:

D:\software\Morn>make --version
GNU Make 4.2.1
Built for x86_64-w64-mingw32
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

使用 Visual Studio 2022 Developer Command Prompt v17.5.1 编译时也发生类似的错误:

PS D:\software\Morn> make -f mingw_makefile
gcc -O2 -fPIC -Wall -fopenmp -I ./include -c src/ptc/morn_coroutine.c -o src/ptc/morn_coroutine.ob
src/ptc/morn_coroutine.c: In function 'm_CoroutineInfo':
src/ptc/morn_coroutine.c:50:38: error: function-scope 'handle' implicitly auto and declared '__thread'
   50 |     __thread struct HandleCoroutine *handle=morn_coroutine_handle;
      |                                      ^~~~~~
make: *** [mingw_makefile:86: src/ptc/morn_coroutine.ob] Error 1

请问这种情况下我应该如何操作啊

Polaris1123 avatar May 05 '23 02:05 Polaris1123