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

请问编译server时变量找不到: variant or associated item not found in Union help: there is a variant with a similar name: RegisterPeer #9

Open
tpcodehub opened this issue Dec 28, 2023 · 2 comments

Comments

@tpcodehub
Copy link

在windows上编译server报错, 请问编译server时变量找不到, 是怎么回事, 都是同一类型的错误

image

PS E:\BaiduNetdiskDownload\pierces\rustdesk\rustdesk_server_agent\server_src> cargo build
warning: unused import: fs
--> libs\hbb_common\src\config.rs:6:5
|
6 | fs,
| ^^
|
= note: #[warn(unused_imports)] on by default

warning: hbb_common (lib) generated 1 warning (run cargo fix --lib -p hbb_common to apply 1 suggestion)
Compiling server v1.0.0 (E:\BaiduNetdiskDownload\pierces\rustdesk\rustdesk_server_agent\server_src)
error[E0599]: no variant or associated item named register_peer found for enum hbb_common::rendezvous_proto::rendezvous_message::Union in the current scope
--> src\bin\main3.rs:135:45
|
135 | Some(rendezvous_message::Union::register_peer(rp)) => {
| ^^^^^^^^^^^^^
| |
| variant or associated item not found in Union
| help: there is a variant with a similar name: RegisterPeer

error[E0599]: no variant or associated item named register_pk found for enum hbb_common::rendezvous_proto::rendezvous_message::Union in the current scope
--> src\bin\main3.rs:141:45
|
141 | Some(rendezvous_message::Union::register_pk(_)) => {
| ^^^^^^^^^^^
| |
| variant or associated item not found in Union
| help: there is a variant with a similar name: RegisterPk

error[E0599]: no variant or associated item named punch_hole_request found for enum hbb_common::rendezvous_proto::rendezvous_message::Union in the current scope
--> src\bin\main3.rs:53:61
|
53 | ... Some(rendezvous_message::Union::punch_hole_request(ph)) => {
| ^^^^^^^^^^^^^^^^^^
| |
| variant or associated item not found in Union
| help: there is a variant with a similar name: PunchHoleRequest

error[E0599]: no variant or associated item named relay_response found for enum hbb_common::rendezvous_proto::rendezvous_message::Union in the current scope
--> src\bin\main3.rs:64:61
|
64 | ... Some(rendezvous_message::Union::relay_response(_)) => {
| ^^^^^^^^^^^^^^
| |
| variant or associated item not found in Union
| help: there is a variant with a similar name: RelayResponse

For more information about this error, try rustc --explain E0599.
error: could not compile server (bin "main3") due to 4 previous errors

@tpcodehub
Copy link
Author

我知道是怎么一回事了, 我在网上找了一份其他的rustdesk_demo, 那份可以编译成功, 比较了一下, 一目了然, 就是几个main.rs中的函数名写错了, 本应该写成 RegisterPeer, 结果按照原来的写成了 register_peer, 在main.rs中将函数名改过来后, 立马编译成功
image

@codeStoreSite
Copy link

codeStoreSite commented Jun 5, 2024

@tpcodehub 大佬,请问有编译好的windows版的服务端吗

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