Skip to content
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平台上使用msvc编译失败. #183

Open
qd1332543 opened this issue Oct 21, 2021 · 2 comments
Open

在windows平台上使用msvc编译失败. #183

qd1332543 opened this issue Oct 21, 2021 · 2 comments

Comments

@qd1332543
Copy link

qd1332543 commented Oct 21, 2021

Describe the bug

When I used the code compiled by msbuild for unit testing, the test failed. The specific failure is as follows:

"F:\tencent\libco\build_amd64\libco.sln" (Rebuild target) (1) ->
"F:\tencent\libco\build_amd64\colib_shared.vcxproj.metaproj" (Rebuild target) (3) ->
"F:\tencent\libco\build_amd64\colib_shared.vcxproj" (Rebuild target) (14) ->
(ClCompile target) -> 
  F:\tencent\libco\co_epoll.h(31,10): fatal error C1083: Cannot open include file: 'sys/epoll.h': No such file or directory (d:\a01\_work\34\s\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1964) [F:\tencent\libco\build_amd64\colib_shared.vcxproj]
  F:\tencent\libco\co_hook_sys_call.cpp(19,10): fatal error C1083: Cannot open include file: 'sys/socket.h': No such file or directory (d:\a01\_work\34\s\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1964) [F:\tencent\libco\build_amd64\colib_shared.vcxproj]
  F:\tencent\libco\co_routine.h(23,10): fatal error C1083: Cannot open include file: 'sys/poll.h': No such file or directory (d:\a01\_work\34\s\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1964) [F:\tencent\libco\build_amd64\colib_shared.vcxproj]
  F:\tencent\libco\coctx.cpp(86,44): error C2143: syntax error: missing ';' before 'asm' [F:\tencent\libco\build_amd64\colib_shared.vcxproj]
  F:\tencent\libco\coctx.cpp(86,60): error C2290: C++ 'asm' syntax ignored. Use __asm. [F:\tencent\libco\build_amd64\colib_shared.vcxproj]

To Reproduce

Steps to reproduce the behavior:

1. git clone https://github.com/Tencent/libco
   git -C "F:\Tencent\libco" rev-parse --git-dir
   git -C "F:\Tencent\libco" clean -xdf
   git -C "F:\Tencent\libco" fetch --recurse-submodules=no --force
   git -C "F:\Tencent\libco" reset --hard dc6aafc
   git -C "F:\Tencent\libco" remote prune origin
2. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
3. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release ..
4. msbuild /m /p:Platform=x64 /p:Configuration=Release libco.sln /t:Rebuild /p:BuildInParallel=true

Expected behavior
Build pass.

Observed Behavior
build failed.

Environment
What version of VW did you use?
What OS or language did you use?
OS: Windows Server 2016 1607
CPU: AMD EPYC 7452 32-Core Processor
Compiler: MSVC 14.29.30133
Language: ENU

Additional context
You can also check build error messages from attached file build.log

@staneychan
Copy link

这很明显需要依赖linux下的头文件,sys/epoll.h, 找个代替的。很多开源代码可以找到。
但这样做就可能失去了意义。

@qd1332543
Copy link
Author

好的,谢谢你的回复!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants