Open beijihuohu1 opened 3 years ago
I'm afraid that we are going to need more parts of the log to know what's going on. I suggest that you look for error C
or error L
to see the exact problem raised by the compiler.
I just ran into the same issue. Here is the verbose log
3221225781
is quite cryptic, but it actually means that the command:
C:\Users\Sebastian\Documents\Coding Projects\gz-ws\protobuf-3.15.2\cmake\build\Release\bin\protoc.exe" "--proto_path=C:/Users/Sebastian/Documents/Coding Projects/gz-ws/ign-msgs/proto" "--plugin=protoc-gen-ignmsgs=C:/Users/Sebastian/Documents/Coding Projects/gz-ws/ign-msgs/build/src/ign_msgs_gen.exe" "--cpp_out=dllexport_decl=IGNITION_MSGS_VISIBLE:C:/Users/Sebastian/Documents/Coding Projects/gz-ws/ign-msgs/build/include" --ignmsgs_out "C:/Users/Sebastian/Documents/Coding Projects/gz-ws/ign-msgs/build/include" "C:/Users/Sebastian/Documents/Coding Projects/gz-ws/ign-msgs/proto/ignition/msgs/altimeter.proto"
is failing due to some missing dll
.
I suggest to make sure that all the dll required by both C:\Users\Sebastian\Documents\Coding Projects\gz-ws\protobuf-3.15.2\cmake\build\Release\bin\protoc.exe
and C:/Users/Sebastian/Documents/Coding Projects/gz-ws/ign-msgs/build/src/ign_msgs_gen.exe
are either in the directory that contains the .exe, or in the PATH. This can be easily verified by opening the .exe in the same terminal you are using to compile (to ensure that the PATH is the same) with https://github.com/lucasg/Dependencies . In particular, as you compile protobuf on your own, are you sure that all the dll of protobuf required by C:/Users/Sebastian/Documents/Coding Projects/gz-ws/ign-msgs/build/src/ign_msgs_gen.exe are either part of the ign_msgs_gen.exe
's directory or in the PATH?
Just as curiosity, there is any specific reason why you compiled protobuf on your own instead of relying on a package manager like vcpkg or conda?
Solved 👍
Protobuf's /bin
folder was not on my path, and adding it solved the problem. The error message (-ignmsgs_out: protoc-gen-ignmsgs: Plugin failed with status code 3221225781.
) is quite cryptic...
Edit
@traversaro Beat me to it. It was indeed a missing .dll
.
Just as curiosity, there is any specific reason why you compiled protobuf on your own instead of relying on a package manager like vcpkg or conda?
I downloaded the precompiled binaries, but they don't come with a cmake config (and produced the same cryptic error), so I decided to compile protobuf from source instead. This solved the cmake
side, but didn't help with the cryptic error (which makes total sense in retrospect).
As to why I don't use vckpg
I have no good reason; it simply never occurred to me. I mainly program in python and C++ on linux, so my approach to working with C++ on Windows is likely a little masochistic...
1>Running protoc on E:/product/gs_ws/ign-msgs/proto/ignition/msgs/altimeter.proto 1>--ignmsgs_out: protoc-gen-ignmsgs: Plugin failed with status code 3221225781. 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: I dont known why.