-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows mingw环境下编译报错,'InitOnceExecuteOnce' was not declared in this scope #421
Comments
恰巧路过,看了下你的报错,大概是宏展开问题。 |
Github Actions 里保证了windows msvc能编译通过,mingw如果有编译问题可以修了提PR |
hmutex.h这个头文件里用了宏_MSC_VER,不是区分的os,而是编译器。 至于编译问题,我昨天都编译了一份mingw版本的最新libhv,静态库lib,不影响。 |
大佬留个联系方式,帮我看一下我这一直编译不过,谢谢 |
我用的是Qt5.12里的mingw,动态库能编过但是链接时报错 |
mingw下需要加预编译宏 |
在你自己的工程里加-D_WIN32_WINNT=0x0600 |
感谢大家的帮助,在自己项目工程中添加-D_WIN32_WINNT=0x0600能够顺利编过。再次感谢作者的耐心帮助,问题关闭。 |
如图所示,编译动态库能编译通过,但是在自己程序中使用libhv时报错,hmutex.h里
'InitOnceExecuteOnce' was not declared in this scope
'InitializeSRWLock' was not declared in this scope
........
电脑环境WIN10,mingw,gcc version 7.3.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)
使用CMake -G "MinGW Makefiles" ../ 和cmake --build ./ 命令能够生产动态库
(自己希望的一套代码能够不修改可以在win和Linux下都能跑,现在只有win下报错,Linux下不报错)
新人一枚,恳请大佬能够协助解决一下,不胜感激。
编译编译静态库也是报同样的错误
The text was updated successfully, but these errors were encountered: