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

compile this proto fails. may be a compatibility problem #102

Closed
nineKnight opened this issue Jan 5, 2021 · 7 comments
Closed

compile this proto fails. may be a compatibility problem #102

nineKnight opened this issue Jan 5, 2021 · 7 comments
Labels

Comments

@nineKnight
Copy link

File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).

vscode

版本: 1.52.1 (user setup)
提交: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
日期: 2020-12-16T16:34:46.910Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042

@shenglingshi
Copy link

shenglingshi commented Jan 5, 2021

生成单个proto文件也报同样的错误.生成所有文件就可以。

@zxh0
Copy link
Owner

zxh0 commented Jan 5, 2021

收到,谢谢提交反馈。我会抽时间来fix这个问题。

@zxh0 zxh0 added the bug label Jan 5, 2021
@nineKnight nineKnight changed the title compile this proto fails. maybe a compatibility problem compile this proto fails. may be a compatibility problem Jan 5, 2021
@shenglingshi
Copy link

收到,谢谢提交反馈。我会抽时间来fix这个问题。

通过调试源代码发现,不是插件的bug,是配置的问题。因为我们写的proto文件里引用了其他的proto文件,protoc在搜索引用路径的时候出错了,只要在配置文件protoc下的options添加--proto_path指定引用文件的搜索路径就好了。

@zxh0 zxh0 closed this as completed Jan 7, 2021
@zxh0
Copy link
Owner

zxh0 commented Jan 7, 2021

issue#101也是同样的问题,对吗?

@nineKnight
Copy link
Author

#101 不清楚是不是同样的问题

@nineKnight
Copy link
Author

nineKnight commented Jan 7, 2021

原本的配置(不可用)

{
    "options": [
        "--proto_path=.",
        "--proto_path=D:\\vcpkg\\installed\\x64-windows-static-md\\include",
        "--cpp_out=.",
    ]
}

当前的配置(可用)

{
    "options": [
        "--proto_path=${workspaceRoot}",
        "--proto_path=D:\\vcpkg\\installed\\x64-windows-static-md\\include",
        "--cpp_out=.",
    ]
}

@zxh0 我遇到的问题跟 @shenglingshi 的可能不是同一个

@zxh0 zxh0 reopened this Jan 7, 2021
@tonychen007
Copy link

原本的配置(不可用)

{
    "options": [
        "--proto_path=.",
        "--proto_path=D:\\vcpkg\\installed\\x64-windows-static-md\\include",
        "--cpp_out=.",
    ]
}

当前的配置(可用)

{
    "options": [
        "--proto_path=${workspaceRoot}",
        "--proto_path=D:\\vcpkg\\installed\\x64-windows-static-md\\include",
        "--cpp_out=.",
    ]
}

@zxh0 我遇到的问题跟 @shenglingshi 的可能不是同一个

It works for me

zxh0 added a commit that referenced this issue Jul 9, 2021
@zxh0 zxh0 closed this as completed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants