-
Notifications
You must be signed in to change notification settings - Fork 464
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
protoc_gen_hertz returns error: exit status 1 #919
Comments
This issue has been marked as invalid question, please give more information by following the |
Describe the Question 这个问题来自于官方示例:hz 使用 (protobuf) | CloudWeGo 按照步骤,在完成 idl 的编写后,执行命令 hz new -I idl -idl idl/hello/hello.proto
#plugin protoc_gen_hertz returns error: exit status 1, cause:
#google/protobuf/descriptor.proto: File not found.
#api.proto:6:1: Import "google/protobuf/descriptor.proto" was not found or had errors.
#api.proto:10:8: "google.protobuf.FieldOptions" is not defined.
#... Reproducible Code 我是在 Windows 系统下编写此示例
Screenshots Hertz version: hz --version
#hz version v0.6.6 Environment: go env
#set GO111MODULE=auto
#set GOARCH=amd64
#set GOBIN=
#set GOCACHE=C:\Users\cc\AppData\Local\go-build
#set GOENV=C:\Users\cc\AppData\Roaming\go\env
#set GOEXE=.exe
#set GOEXPERIMENT=
#set GOFLAGS=
#set GOHOSTARCH=amd64
#set GOHOSTOS=windows
#set GOINSECURE=
#set GOMODCACHE=D:\workspace\golang\pkg\mod
#set GONOPROXY=
#set GONOSUMDB=
#set GOOS=windows
#set GOPATH=D:\workspace\golang
#set GOPRIVATE=
#set GOPROXY=https://goproxy.cn,direct
#set GOROOT=D:\Go
#set GOSUMDB=sum.golang.org
#set GOTMPDIR=
#set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
#set GOVCS=
#set GOVERSION=go1.19.4
#set GCCGO=gccgo
#set GOAMD64=v1
#set AR=ar
#set CC=gcc
#set CXX=g++
#set CGO_ENABLED=1
#set GOMOD=D:\workspace\golang\src\proto_demo\go.mod
#set GOWORK=
#set CGO_CFLAGS=-g -O2
#set CGO_CPPFLAGS=
#set CGO_CXXFLAGS=-g -O2
#set CGO_FFLAGS=-g -O2
#set CGO_LDFLAGS=-g -O2
#set PKG_CONFIG=pkg-config
#set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\cc\AppData\Local\Temp\go-build3905511486=/tmp/go-build -gno-record-gcc-switches |
下载protoc的时候里面有个include文件夹,使用的时候可以指定到 |
This issue has been marked as invalid question, please give more information by following the |
According to
hertz
official example, I importedgoogle/protobuf/descriptor.proto
inidl/api.proto
file.When I execute the generate command, it throws an error
google/protobuf/descriptor.proto: File not found.
.The same code, in a Linux environment is fine. I don't know if this is a bug or if it's a windows issue.
Official example: https://www.cloudwego.io/zh/docs/hertz/tutorials/toolkit/usage-protobuf/
The text was updated successfully, but these errors were encountered: