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

error C++ compilation of rule '@protobuf//:protobuf' failed (Exit 2). cl: 命令行 error D8021 :无效的数值参数“/Wwrite-strings” #122

Open
thomas1984 opened this issue Jun 22, 2018 · 2 comments

Comments

@thomas1984
Copy link

thomas1984 commented Jun 22, 2018

ERROR: C:/users/thomas/appdata/local/temp/_bazel_thomas/infhcau0/external/protob
uf/BUILD:113:1: C++ compilation of rule '@protobuf//:protobuf' failed (Exit 2):
cl.exe failed: error executing command
cd C:/users/thomas/appdata/local/temp/_bazel_thomas/infhcau0/execroot/main

SET INCLUDE=F:\Tools\Microsoft Visual Studio 14.0\VC\INCLUDE;F:\Tools\Microsof
t Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\in
clude\10.0.14393.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\inclu
de\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\shared;C:\Prog
ram Files (x86)\Windows Kits\10\include\10.0.14393.0\um;C:\Program Files (x86)\W
indows Kits\10\include\10.0.14393.0\winrt;
SET LIB=F:\Tools\Microsoft Visual Studio 14.0\VC\LIB\amd64;F:\Tools\Microsof
t Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10
lib\10.0.14393.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib
\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.14393.0\um\x64;
SET PATH=F:\Tools\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions
Microsoft\TestWindow;F:\Tools\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\WINDO
WS\Microsoft.NET\Framework64\v4.0.30319;F:\Tools\Microsoft Visual Studio 14.0\VC
\VCPackages;F:\Tools\Microsoft Visual Studio 14.0\Common7\IDE;F:\Tools\Microsoft
Visual Studio 14.0\Common7\Tools;F:\Tools\Microsoft Visual Studio 14.0\Team Too
ls\Performance Tools\x64;F:\Tools\Microsoft Visual Studio 14.0\Team Tools\Perfor
mance Tools;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86
)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\b
in\NETFX 4.6.1 Tools\x64;;C:\WINDOWS\system32
SET PWD=/proc/self/cwd
SET TEMP=C:\Users\Thomas\AppData\Local\Temp
SET TMP=C:\Users\Thomas\AppData\Local\Temp
F:/Tools/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe /c external/protobuf
/src/google/protobuf/struct.pb.cc /Fobazel-out/msvc_x64-fastbuild/bin/external/p
rotobuf/objs/protobuf/external/protobuf/src/google/protobuf/struct.pb.o /nologo
/DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D

CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm50
0 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /Iexternal/protobuf /Ibazel-o
ut/msvc_x64-fastbuild/genfiles/external/protobuf /Iexternal/bazel_tools /Ibazel-
out/msvc_x64-fastbuild/genfiles/external/bazel_tools /Iexternal/protobuf/src /Ib
azel-out/msvc_x64-fastbuild/genfiles/external/protobuf/src /Iexternal/bazel_tool
s/tools/cpp/gcc3 /showIncludes /MT /Od /Z7 -DHAVE_PTHREAD -Wall -Wwrite-strings
-Woverloaded-virtual -Wno-sign-compare -Wno-unused-function.
cl: 命令行 error D8021 :无效的数值参数“/Wwrite-strings”
Target //kcws/cc:seg_backend_api failed to build
____Elapsed time: 2.704s, Critical Path: 0.13s

@thomas1984 thomas1984 changed the title 大神,请教下。windows编译问题 大神,请教下。bazel编译问题 Jun 26, 2018
@thomas1984 thomas1984 changed the title 大神,请教下。bazel编译问题 error C++ compilation of rule '@protobuf//:protobuf' failed (Exit 2). cl: 命令行 error D8021 :无效的数值参数“/Wwrite-strings” Jun 26, 2018
@clin366
Copy link

clin366 commented Feb 19, 2019

我也遇到了

@ftxe
Copy link

ftxe commented Nov 3, 2021

我也遇到了

这个问题怎么没有回答。 我回答一下我遇到的情况吧。
问题:我是在linux编译是正常可以通过的,但是windows编译报同样的错。
解决方法:在windows编译的cmakelist中去掉编译选项-Wwrite-strings即可。

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

3 participants