Can't build on Windows: crate::VERSION not found #1291

Closed
opened 2026-02-20 23:23:01 -05:00 by deekerman · 5 comments
Owner

Originally created by @tognols on GitHub (Jan 27, 2023).

Hi, I'm trying to build rustdesk on the master branch for Windows (I assume it's the nightly build since the nightly "Source Code.zip" is dated October 20 2022).

I followed all the steps from the docs and from the README.md to build on Windows. (downloading msvc, llvm, vcpkg, sciter.dll)

I installed rust with rustup and i'm in the stable msvc channel.

The error seems to be about mod version in lib.rs not being found.

Here is the full log including the cloning of the repo, I don't know what to do

PS C:\Users\TGN> git clone https://github.com/rustdesk/rustdesk.git
Cloning into 'rustdesk'...
remote: Enumerating objects: 28674, done.
remote: Counting objects: 100% (6083/6083), done.
remote: Compressing objects: 100% (306/306), done.
remote: Total 28674 (delta 5836), reused 5857 (delta 5773), pack-reused 22591
Receiving objects: 100% (28674/28674), 18.88 MiB | 7.43 MiB/s, done.
Resolving deltas: 100% (20675/20675), done.
PS C:\Users\TGN> cd rustdesk
PS C:\Users\TGN\rustdesk> cargo run
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.47
   Compiling quote v1.0.21
   Compiling unicode-ident v1.0.5
   Compiling cfg-if v1.0.0
   Compiling syn v1.0.105
   Compiling winapi v0.3.9
   Compiling memchr v2.5.0
   Compiling serde_derive v1.0.149
   Compiling log v0.4.17
   Compiling serde v1.0.149
   Compiling libc v0.2.138
   Compiling jobserver v0.1.25
   Compiling cc v1.0.77
   Compiling once_cell v1.16.0
   Compiling scopeguard v1.1.0
   Compiling pin-project-lite v0.2.9
   Compiling windows_x86_64_msvc v0.42.0
   Compiling lock_api v0.4.9
   Compiling slab v0.4.7
   Compiling futures-core v0.3.25
   Compiling smallvec v1.10.0
   Compiling either v1.8.0
   Compiling futures-sink v0.3.25
   Compiling windows-sys v0.42.0
   Compiling futures-task v0.3.25
   Compiling indexmap v1.9.2
   Compiling futures-util v0.3.25
   Compiling thiserror v1.0.37
   Compiling version_check v0.9.4
   Compiling aho-corasick v0.7.20
   Compiling pin-utils v0.1.0
   Compiling hashbrown v0.12.3
   Compiling parking_lot_core v0.9.5
   Compiling futures-io v0.3.25
   Compiling num_cpus v1.14.0
   Compiling regex-syntax v0.6.28
   Compiling tokio v1.23.0
   Compiling lazy_static v1.4.0
   Compiling autocfg v0.1.8
   Compiling rand_core v0.4.2
   Compiling which v4.3.0
   Compiling bitflags v1.3.2
   Compiling tracing-core v0.1.30
   Compiling futures-channel v0.3.25
   Compiling humantime v2.1.0
   Compiling tracing v0.1.37
   Compiling rand_core v0.3.1
   Compiling num-traits v0.2.15
   Compiling itoa v1.0.4
   Compiling mio v0.8.5
   Compiling fastrand v1.8.0
   Compiling parking_lot v0.12.1
   Compiling anyhow v1.0.66
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling proc-macro-error-attr v1.0.4
   Compiling getrandom v0.2.8
   Compiling pkg-config v0.3.26
   Compiling regex v1.7.0
   Compiling protobuf v3.2.0
   Compiling zstd-sys v1.6.2+zstd.1.5.1
   Compiling rand v0.6.5
   Compiling proc-macro-error v1.0.4
   Compiling siphasher v0.2.3
   Compiling winapi-util v0.1.5
   Compiling atty v0.2.14
   Compiling remove_dir_all v0.5.3
   Compiling rand_os v0.1.3
   Compiling rand_jitter v0.1.4
   Compiling phf_shared v0.7.24
   Compiling tempfile v3.3.0
   Compiling termcolor v1.1.3
   Compiling same-file v1.0.6
   Compiling walkdir v2.3.2
   Compiling rand_core v0.6.4
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling ppv-lite86 v0.2.17
   Compiling glob v0.3.0
   Compiling env_logger v0.9.3
   Compiling num-integer v0.1.45
   Compiling libsodium-sys v0.2.7
   Compiling rand_chacha v0.3.1
   Compiling zstd-safe v4.1.3+zstd.1.5.1
   Compiling heck v0.4.0
   Compiling rand v0.8.5
   Compiling clang-sys v1.4.0
   Compiling phf_generator v0.7.24
   Compiling ring v0.16.20
   Compiling crossbeam-utils v0.8.14
   Compiling signature v1.6.4
   Compiling ryu v1.0.11
   Compiling winapi-build v0.1.1
   Compiling rustversion v1.0.9
   Compiling ed25519 v1.5.2
   Compiling phf_codegen v0.7.24
   Compiling unicode-width v0.1.10
   Compiling minimal-lexical v0.2.1
   Compiling dasp_sample v0.11.0
   Compiling textwrap v0.11.0
   Compiling target_build_utils v0.3.1
   Compiling socket2 v0.4.7
   Compiling nom v7.1.1
   Compiling dirs-sys-next v0.1.2
   Compiling libloading v0.7.4
   Compiling num-traits v0.1.43
   Compiling filetime v0.2.19
   Compiling strsim v0.8.0
   Compiling untrusted v0.7.1
   Compiling serde v0.9.15
   Compiling os_str_bytes v6.4.1
   Compiling spin v0.5.2
   Compiling dtoa v0.4.8
   Compiling itoa v0.3.4
   Compiling vec_map v0.8.2
   Compiling adler v1.0.2
   Compiling bindgen v0.59.2
   Compiling clap_lex v0.2.4
   Compiling clap v2.34.0
   Compiling dasp_frame v0.11.0
   Compiling time v0.1.45
   Compiling iana-time-zone v0.1.53
   Compiling phf v0.7.24
   Compiling memoffset v0.7.1
   Compiling typenum v1.16.0
   Compiling peeking_take_while v0.1.2
   Compiling textwrap v0.16.0
   Compiling serde_json v1.0.89
   Compiling lazycell v1.3.0
   Compiling rustc-hash v1.1.0
   Compiling shlex v1.1.0
   Compiling strsim v0.10.0
   Compiling cexpr v0.6.0
   Compiling chrono v0.4.23
   Compiling directories-next v2.0.0
   Compiling winreg v0.6.2
   Compiling ws2_32-sys v0.2.1
   Compiling kernel32-sys v0.2.2
   Compiling generic-array v0.14.6
   Compiling crossbeam-epoch v0.9.13
   Compiling serde_json v0.9.10
   Compiling parking_lot_core v0.8.5
   Compiling semver v1.0.14
   Compiling fnv v1.0.7
   Compiling winapi v0.2.8
   Compiling camino v1.1.1
   Compiling machine-uid v0.2.0
   Compiling thiserror-impl v1.0.37
   Compiling futures-macro v0.3.25
   Compiling tokio-macros v1.8.2
   Compiling pin-project-internal v1.0.12
   Compiling clap_derive v3.2.18
   Compiling dirs-next v2.0.0
   Compiling mac_address v1.1.4
   Compiling socket2 v0.3.19
   Compiling backtrace v0.3.66
   Compiling instant v0.1.12
   Compiling tinyvec_macros v0.1.0
   Compiling httparse v1.8.0
   Compiling windows_x86_64_msvc v0.34.0
   Compiling protobuf-support v3.2.0
   Compiling pin-project v1.0.12
   Compiling windows_x86_64_msvc v0.28.0
   Compiling dasp_ring_buffer v0.11.0
   Compiling linked-hash-map v0.5.6
   Compiling gimli v0.26.2
   Compiling rustls v0.20.7
   Compiling cbindgen v0.24.3
   Compiling cfg-if v0.1.10
   Compiling net2 v0.2.38
   Compiling yaml-rust v0.4.5
   Compiling tinyvec v1.6.0
   Compiling clap v3.2.23
   Compiling futures-executor v0.3.25
   Compiling futures v0.3.25
   Compiling miniz_oxide v0.5.4
   Compiling crossbeam-channel v0.5.6
   Compiling addr2line v0.17.0
   Compiling webm-sys v1.0.3
   Compiling object v0.29.0
   Compiling try-lock v0.2.3
   Compiling rayon-core v1.10.1
   Compiling windows_x86_64_msvc v0.30.0
   Compiling rustc-demangle v0.1.21
   Compiling crc32fast v1.3.2
   Compiling percent-encoding v2.2.0
   Compiling form_urlencoded v1.1.0
   Compiling want v0.3.0
   Compiling unicode-normalization v0.1.22
   Compiling crossbeam-deque v0.8.2
   Compiling parking_lot v0.11.2
   Compiling dasp_rms v0.11.0
   Compiling enum_dispatch v0.3.8
   Compiling extend v1.1.2
   Compiling delegate v0.8.0
   Compiling enum-map-derive v0.10.0
   Compiling dasp_peak v0.11.0
   Compiling err-derive v0.3.1
   Compiling itertools v0.10.5
   Compiling num-bigint v0.4.3
   Compiling ntapi v0.3.7
   Compiling iovec v0.1.4
   Compiling crossbeam-queue v0.3.8
   Compiling tower-service v0.3.2
   Compiling topological-sort v0.2.2
   Compiling pathdiff v0.2.1
   Compiling unicode-bidi v0.3.8
   Compiling unicode-xid v0.2.4
   Compiling str-buf v1.0.6
   Compiling tfc v0.6.1 (https://github.com/fufesou/The-Fat-Controller#a5f13e6e)
   Compiling httpdate v1.0.2
   Compiling winreg v0.10.1
   Compiling winit v0.26.1
   Compiling encoding_rs v0.8.31
   Compiling bytes v1.3.0
   Compiling toml v0.5.9
   Compiling sodiumoxide v0.2.7
   Compiling cargo-platform v0.1.2
   Compiling miow v0.2.2
   Compiling serde_yaml v0.8.26
   Compiling cty v0.2.2
   Compiling http v0.2.8
   Compiling confy v0.4.0 (https://github.com/open-trade/confy#630cc28a)
   Compiling cargo_metadata v0.14.2
   Compiling http-body v0.4.5
   Compiling convert_case v0.5.0
   Compiling winres v0.1.12
   Compiling mio v0.6.23
   Compiling raw-window-handle v0.4.3
   Compiling magnum-opus v0.4.0 (https://github.com/rustdesk/magnum-opus#79be072c)
   Compiling scrap v0.5.0 (C:\Users\TGN\rustdesk\libs\scrap)
   Compiling error-code v2.3.1
   Compiling synstructure v0.12.6
   Compiling idna v0.3.0
   Compiling failure v0.1.8
   Compiling enum-map v2.4.1
   Compiling flutter_rust_bridge_codegen v1.61.1
   Compiling dasp_envelope v0.11.0
   Compiling windows-sys v0.28.0
   Compiling windows v0.34.0
   Compiling protobuf-parse v3.2.0
   Compiling tokio-util v0.7.4
   Compiling protobuf-codegen v3.2.0
   Compiling tokio-socks v0.5.1-1 (https://github.com/open-trade/tokio-socks#7034e792)
   Compiling h2 v0.3.15
   Compiling block-buffer v0.10.3
   Compiling crypto-common v0.1.6
   Compiling dasp_interpolate v0.11.0
   Compiling strum_macros v0.24.3
   Compiling miniz_oxide v0.6.2
   Compiling dasp_window v0.11.1
   Compiling miow v0.3.7
   Compiling hyper v0.14.23
   Compiling enigo v0.0.14 (C:\Users\TGN\rustdesk\libs\enigo)
   Compiling impersonate_system v0.1.0 (https://github.com/21pages/impersonate-system#84b40189)
   Compiling runas v0.2.1
   Compiling clipboard v0.1.0 (C:\Users\TGN\rustdesk\libs\clipboard)
   Compiling cpal v0.13.5
   Compiling strum v0.24.1
   Compiling widestring v1.0.2
   Compiling time-macros v0.2.4
   Compiling base64 v0.13.1
   Compiling async-trait v0.1.59
   Compiling sysinfo v0.24.7
   Compiling rustls-pemfile v1.0.1
   Compiling win-sys v0.3.1
   Compiling mio-named-pipes v0.1.7
   Compiling flate2 v1.0.25
   Compiling dasp_signal v0.11.0
   Compiling digest v0.10.6
   Compiling windows v0.30.0
   Compiling rdev v0.5.0-2 (https://github.com/fufesou/rdev#1be26c7e)
   Compiling miow v0.4.0
   Compiling rayon v1.6.1
   Compiling webpki v0.22.0
   Compiling sct v0.7.0
   Compiling time v0.3.9
   Compiling webpki-roots v0.22.6
   Compiling hbb_common v0.1.0 (C:\Users\TGN\rustdesk\libs\hbb_common)
   Compiling url v2.3.1
   Compiling which v3.1.1
   Compiling clipboard-win v4.4.2
   Compiling serde_urlencoded v0.7.1
   Compiling dasp_slice v0.11.0
   Compiling rtoolbox v0.0.1
   Compiling ansi_term v0.12.1
   Compiling tokio-rustls v0.23.4
   Compiling cpufeatures v0.2.5
   Compiling widestring v0.4.3
   Compiling ipnet v2.6.0
   Compiling byteorder v1.4.3
   Compiling hyper-rustls v0.23.2
   Compiling block v0.1.6
   Compiling debug-helper v0.3.13
   Compiling memalloc v0.1.0
   Compiling mime v0.3.16
   Compiling default-net v0.11.0 (https://github.com/Kingtous/default-net#bdaad8dd)
   Compiling cidr-utils v0.5.9
   Compiling trayicon v0.1.3-1 (https://github.com/open-trade/trayicon-rs#8d9c4489)
   Compiling reqwest v0.11.13
   Compiling repng v0.2.2
   Compiling windows-service v0.4.0
   Compiling flexi_logger v0.22.6
   Compiling sha2 v0.10.6
   Compiling dasp v0.11.0
   Compiling rpassword v7.2.0
   Compiling arboard v2.1.1
   Compiling parity-tokio-ipc v0.7.3-1 (https://github.com/open-trade/parity-tokio-ipc#20b28959)
   Compiling shared_memory v0.12.4
   Compiling system_shutdown v3.0.0
   Compiling wol-rs v0.9.1
   Compiling errno v0.2.8
   Compiling sys-locale v0.2.3
   Compiling uuid v1.2.2
   Compiling ctrlc v3.2.4
   Compiling sciter-rs v0.5.57 (https://github.com/open-trade/rust-sciter?branch=dyn#82025b9b)
   Compiling whoami v1.2.3
   Compiling shutdown_hooks v0.1.0
   Compiling webm v1.0.2
   Compiling zstd v0.9.2+zstd.1.5.1
   Compiling virtual_display v0.1.0 (C:\Users\TGN\rustdesk\libs\virtual_display)
warning: the type `DXGI_OUTDUPL_DESC` does not permit being left uninitialized
  --> libs\scrap\src\dxgi\mod.rs:61:33
   |
61 |         let mut desc = unsafe { mem::MaybeUninit::uninit().assume_init() };
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                                 |
   |                                 this code causes undefined behavior when executed
   |                                 help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
   |
   = note: integers must be initialized
   = note: `#[warn(invalid_value)]` on by default

warning: the type `DXGI_OUTDUPL_FRAME_INFO` does not permit being left uninitialized
   --> libs\scrap\src\dxgi\mod.rs:179:24
    |
179 |         let mut info = mem::MaybeUninit::uninit().assume_init();
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        this code causes undefined behavior when executed
    |                        help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
    |
    = note: integers must be initialized

warning: the type `DXGI_MAPPED_RECT` does not permit being left uninitialized
   --> libs\scrap\src\dxgi\mod.rs:188:24
    |
188 |         let mut rect = mem::MaybeUninit::uninit().assume_init();
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                        |
    |                        this code causes undefined behavior when executed
    |                        help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
    |
    = note: integers must be initialized

warning: the type `D3D11_TEXTURE2D_DESC` does not permit being left uninitialized
   --> libs\scrap\src\dxgi\mod.rs:207:32
    |
207 |         let mut texture_desc = mem::MaybeUninit::uninit().assume_init();
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                |
    |                                this code causes undefined behavior when executed
    |                                help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
    |
    = note: integers must be initialized

warning: the type `winapi::um::wingdi::DISPLAY_DEVICEW` does not permit being left uninitialized
   --> libs\scrap\src\dxgi\mod.rs:365:51
    |
365 |             let mut d: DISPLAY_DEVICEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
    |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                                   |
    |                                                   this code causes undefined behavior when executed
    |                                                   help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
    |
    = note: integers must be initialized

warning: the type `winapi::um::wingdi::DEVMODEW` does not permit being left uninitialized
   --> libs\scrap\src\dxgi\mod.rs:385:44
    |
385 |             let mut m: DEVMODEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                            |
    |                                            this code causes undefined behavior when executed
    |                                            help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
    |
    = note: integers must be initialized

warning: the type `winapi::shared::dxgi::DXGI_OUTPUT_DESC` does not permit being left uninitialized
   --> libs\scrap\src\dxgi\mod.rs:444:28
    |
444 |             let mut desc = mem::MaybeUninit::uninit().assume_init();
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                            |
    |                            this code causes undefined behavior when executed
    |                            help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
    |
    = note: integers must be initialized

warning: `scrap` (lib) generated 7 warnings
   Compiling rustdesk v1.2.0 (C:\Users\TGN\rustdesk)
error[E0583]: file not found for module `version`
  --> src\lib.rs:25:1
   |
25 | mod version;
   | ^^^^^^^^^^^^
   |
   = help: to create the module `version`, create file "src\version.rs" or "src\version\mod.rs"

error[E0432]: unresolved import `crate::VERSION`
 --> src\server\connection.rs:9:18
  |
9 | use crate::{ipc, VERSION};
  |                  ^^^^^^^
  |                  |
  |                  no `VERSION` in the root
  |                  help: a similar name exists in the module: `version`

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\platform\windows.rs:985:38
    |
985 |     let versions: Vec<&str> = crate::VERSION.split(".").collect();
    |                                      ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
    --> src\platform\windows.rs:1144:24
     |
1144 |         version=crate::VERSION,
     |                        ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
  --> src\server\video_service.rs:96:39
   |
96 |         && get_version_number(&crate::VERSION) > get_version_number("1.1.9");
   |                                       ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
    --> src\client.rs:1464:29
     |
1464 |             version: crate::VERSION.to_string(),
     |                             ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\rendezvous_mediator.rs:307:29
    |
307 |             version: crate::VERSION.to_owned(),
    |                             ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\rendezvous_mediator.rs:357:29
    |
357 |             version: crate::VERSION.to_owned(),
    |                             ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\rendezvous_mediator.rs:401:29
    |
401 |             version: crate::VERSION.to_owned(),
    |                             ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\common.rs:514:21
    |
514 |         url: crate::VERSION.to_owned(),
    |                     ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\common.rs:523:77
    |
523 |                 if get_version_number(&version) > get_version_number(crate::VERSION) {
    |                                                                             ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
  --> src\core_main.rs:70:31
   |
70 |         println!("{}", crate::VERSION);
   |                               ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\ui_interface.rs:416:55
    |
416 |         let a = hbb_common::get_version_number(crate::VERSION);
    |                                                       ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
   --> src\ui_interface.rs:651:12
    |
651 |     crate::VERSION.to_owned()
    |            ^^^^^^^ not found in the crate root

error[E0425]: cannot find value `VERSION` in the crate root
  --> src\hbbs_http\sync.rs:57:80
   |
57 |                         v["ver"] = json!(hbb_common::get_version_number(crate::VERSION));
   |                                                                                ^^^^^^^ not found in the crate root

warning: unused import: `crate::ui_interface::using_public_server`
 --> src\ui_session_interface.rs:9:5
  |
9 | use crate::ui_interface::using_public_server;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

Some errors have detailed explanations: E0425, E0432, E0583.
For more information about an error, try `rustc --explain E0425`.
warning: `rustdesk` (lib) generated 1 warning
error: could not compile `rustdesk` due to 15 previous errors; 1 warning emitted
PS C:\Users\TGN\rustdesk> rustup default
stable-x86_64-pc-windows-msvc (default)
PS C:\Users\TGN\rustdesk>

Thanks in advantage

Originally created by @tognols on GitHub (Jan 27, 2023). Hi, I'm trying to build rustdesk on the master branch for Windows (I assume it's the nightly build since the nightly "Source Code.zip" is dated October 20 2022). I followed all the steps from the docs and from the README.md to build on Windows. (downloading msvc, llvm, vcpkg, sciter.dll) I installed rust with rustup and i'm in the stable msvc channel. The error seems to be about mod version in lib.rs not being found. Here is the full log including the cloning of the repo, I don't know what to do ``` PS C:\Users\TGN> git clone https://github.com/rustdesk/rustdesk.git Cloning into 'rustdesk'... remote: Enumerating objects: 28674, done. remote: Counting objects: 100% (6083/6083), done. remote: Compressing objects: 100% (306/306), done. remote: Total 28674 (delta 5836), reused 5857 (delta 5773), pack-reused 22591 Receiving objects: 100% (28674/28674), 18.88 MiB | 7.43 MiB/s, done. Resolving deltas: 100% (20675/20675), done. PS C:\Users\TGN> cd rustdesk PS C:\Users\TGN\rustdesk> cargo run Compiling autocfg v1.1.0 Compiling proc-macro2 v1.0.47 Compiling quote v1.0.21 Compiling unicode-ident v1.0.5 Compiling cfg-if v1.0.0 Compiling syn v1.0.105 Compiling winapi v0.3.9 Compiling memchr v2.5.0 Compiling serde_derive v1.0.149 Compiling log v0.4.17 Compiling serde v1.0.149 Compiling libc v0.2.138 Compiling jobserver v0.1.25 Compiling cc v1.0.77 Compiling once_cell v1.16.0 Compiling scopeguard v1.1.0 Compiling pin-project-lite v0.2.9 Compiling windows_x86_64_msvc v0.42.0 Compiling lock_api v0.4.9 Compiling slab v0.4.7 Compiling futures-core v0.3.25 Compiling smallvec v1.10.0 Compiling either v1.8.0 Compiling futures-sink v0.3.25 Compiling windows-sys v0.42.0 Compiling futures-task v0.3.25 Compiling indexmap v1.9.2 Compiling futures-util v0.3.25 Compiling thiserror v1.0.37 Compiling version_check v0.9.4 Compiling aho-corasick v0.7.20 Compiling pin-utils v0.1.0 Compiling hashbrown v0.12.3 Compiling parking_lot_core v0.9.5 Compiling futures-io v0.3.25 Compiling num_cpus v1.14.0 Compiling regex-syntax v0.6.28 Compiling tokio v1.23.0 Compiling lazy_static v1.4.0 Compiling autocfg v0.1.8 Compiling rand_core v0.4.2 Compiling which v4.3.0 Compiling bitflags v1.3.2 Compiling tracing-core v0.1.30 Compiling futures-channel v0.3.25 Compiling humantime v2.1.0 Compiling tracing v0.1.37 Compiling rand_core v0.3.1 Compiling num-traits v0.2.15 Compiling itoa v1.0.4 Compiling mio v0.8.5 Compiling fastrand v1.8.0 Compiling parking_lot v0.12.1 Compiling anyhow v1.0.66 Compiling rand_chacha v0.1.1 Compiling rand_pcg v0.1.2 Compiling proc-macro-error-attr v1.0.4 Compiling getrandom v0.2.8 Compiling pkg-config v0.3.26 Compiling regex v1.7.0 Compiling protobuf v3.2.0 Compiling zstd-sys v1.6.2+zstd.1.5.1 Compiling rand v0.6.5 Compiling proc-macro-error v1.0.4 Compiling siphasher v0.2.3 Compiling winapi-util v0.1.5 Compiling atty v0.2.14 Compiling remove_dir_all v0.5.3 Compiling rand_os v0.1.3 Compiling rand_jitter v0.1.4 Compiling phf_shared v0.7.24 Compiling tempfile v3.3.0 Compiling termcolor v1.1.3 Compiling same-file v1.0.6 Compiling walkdir v2.3.2 Compiling rand_core v0.6.4 Compiling rand_xorshift v0.1.1 Compiling rand_isaac v0.1.1 Compiling rand_hc v0.1.0 Compiling ppv-lite86 v0.2.17 Compiling glob v0.3.0 Compiling env_logger v0.9.3 Compiling num-integer v0.1.45 Compiling libsodium-sys v0.2.7 Compiling rand_chacha v0.3.1 Compiling zstd-safe v4.1.3+zstd.1.5.1 Compiling heck v0.4.0 Compiling rand v0.8.5 Compiling clang-sys v1.4.0 Compiling phf_generator v0.7.24 Compiling ring v0.16.20 Compiling crossbeam-utils v0.8.14 Compiling signature v1.6.4 Compiling ryu v1.0.11 Compiling winapi-build v0.1.1 Compiling rustversion v1.0.9 Compiling ed25519 v1.5.2 Compiling phf_codegen v0.7.24 Compiling unicode-width v0.1.10 Compiling minimal-lexical v0.2.1 Compiling dasp_sample v0.11.0 Compiling textwrap v0.11.0 Compiling target_build_utils v0.3.1 Compiling socket2 v0.4.7 Compiling nom v7.1.1 Compiling dirs-sys-next v0.1.2 Compiling libloading v0.7.4 Compiling num-traits v0.1.43 Compiling filetime v0.2.19 Compiling strsim v0.8.0 Compiling untrusted v0.7.1 Compiling serde v0.9.15 Compiling os_str_bytes v6.4.1 Compiling spin v0.5.2 Compiling dtoa v0.4.8 Compiling itoa v0.3.4 Compiling vec_map v0.8.2 Compiling adler v1.0.2 Compiling bindgen v0.59.2 Compiling clap_lex v0.2.4 Compiling clap v2.34.0 Compiling dasp_frame v0.11.0 Compiling time v0.1.45 Compiling iana-time-zone v0.1.53 Compiling phf v0.7.24 Compiling memoffset v0.7.1 Compiling typenum v1.16.0 Compiling peeking_take_while v0.1.2 Compiling textwrap v0.16.0 Compiling serde_json v1.0.89 Compiling lazycell v1.3.0 Compiling rustc-hash v1.1.0 Compiling shlex v1.1.0 Compiling strsim v0.10.0 Compiling cexpr v0.6.0 Compiling chrono v0.4.23 Compiling directories-next v2.0.0 Compiling winreg v0.6.2 Compiling ws2_32-sys v0.2.1 Compiling kernel32-sys v0.2.2 Compiling generic-array v0.14.6 Compiling crossbeam-epoch v0.9.13 Compiling serde_json v0.9.10 Compiling parking_lot_core v0.8.5 Compiling semver v1.0.14 Compiling fnv v1.0.7 Compiling winapi v0.2.8 Compiling camino v1.1.1 Compiling machine-uid v0.2.0 Compiling thiserror-impl v1.0.37 Compiling futures-macro v0.3.25 Compiling tokio-macros v1.8.2 Compiling pin-project-internal v1.0.12 Compiling clap_derive v3.2.18 Compiling dirs-next v2.0.0 Compiling mac_address v1.1.4 Compiling socket2 v0.3.19 Compiling backtrace v0.3.66 Compiling instant v0.1.12 Compiling tinyvec_macros v0.1.0 Compiling httparse v1.8.0 Compiling windows_x86_64_msvc v0.34.0 Compiling protobuf-support v3.2.0 Compiling pin-project v1.0.12 Compiling windows_x86_64_msvc v0.28.0 Compiling dasp_ring_buffer v0.11.0 Compiling linked-hash-map v0.5.6 Compiling gimli v0.26.2 Compiling rustls v0.20.7 Compiling cbindgen v0.24.3 Compiling cfg-if v0.1.10 Compiling net2 v0.2.38 Compiling yaml-rust v0.4.5 Compiling tinyvec v1.6.0 Compiling clap v3.2.23 Compiling futures-executor v0.3.25 Compiling futures v0.3.25 Compiling miniz_oxide v0.5.4 Compiling crossbeam-channel v0.5.6 Compiling addr2line v0.17.0 Compiling webm-sys v1.0.3 Compiling object v0.29.0 Compiling try-lock v0.2.3 Compiling rayon-core v1.10.1 Compiling windows_x86_64_msvc v0.30.0 Compiling rustc-demangle v0.1.21 Compiling crc32fast v1.3.2 Compiling percent-encoding v2.2.0 Compiling form_urlencoded v1.1.0 Compiling want v0.3.0 Compiling unicode-normalization v0.1.22 Compiling crossbeam-deque v0.8.2 Compiling parking_lot v0.11.2 Compiling dasp_rms v0.11.0 Compiling enum_dispatch v0.3.8 Compiling extend v1.1.2 Compiling delegate v0.8.0 Compiling enum-map-derive v0.10.0 Compiling dasp_peak v0.11.0 Compiling err-derive v0.3.1 Compiling itertools v0.10.5 Compiling num-bigint v0.4.3 Compiling ntapi v0.3.7 Compiling iovec v0.1.4 Compiling crossbeam-queue v0.3.8 Compiling tower-service v0.3.2 Compiling topological-sort v0.2.2 Compiling pathdiff v0.2.1 Compiling unicode-bidi v0.3.8 Compiling unicode-xid v0.2.4 Compiling str-buf v1.0.6 Compiling tfc v0.6.1 (https://github.com/fufesou/The-Fat-Controller#a5f13e6e) Compiling httpdate v1.0.2 Compiling winreg v0.10.1 Compiling winit v0.26.1 Compiling encoding_rs v0.8.31 Compiling bytes v1.3.0 Compiling toml v0.5.9 Compiling sodiumoxide v0.2.7 Compiling cargo-platform v0.1.2 Compiling miow v0.2.2 Compiling serde_yaml v0.8.26 Compiling cty v0.2.2 Compiling http v0.2.8 Compiling confy v0.4.0 (https://github.com/open-trade/confy#630cc28a) Compiling cargo_metadata v0.14.2 Compiling http-body v0.4.5 Compiling convert_case v0.5.0 Compiling winres v0.1.12 Compiling mio v0.6.23 Compiling raw-window-handle v0.4.3 Compiling magnum-opus v0.4.0 (https://github.com/rustdesk/magnum-opus#79be072c) Compiling scrap v0.5.0 (C:\Users\TGN\rustdesk\libs\scrap) Compiling error-code v2.3.1 Compiling synstructure v0.12.6 Compiling idna v0.3.0 Compiling failure v0.1.8 Compiling enum-map v2.4.1 Compiling flutter_rust_bridge_codegen v1.61.1 Compiling dasp_envelope v0.11.0 Compiling windows-sys v0.28.0 Compiling windows v0.34.0 Compiling protobuf-parse v3.2.0 Compiling tokio-util v0.7.4 Compiling protobuf-codegen v3.2.0 Compiling tokio-socks v0.5.1-1 (https://github.com/open-trade/tokio-socks#7034e792) Compiling h2 v0.3.15 Compiling block-buffer v0.10.3 Compiling crypto-common v0.1.6 Compiling dasp_interpolate v0.11.0 Compiling strum_macros v0.24.3 Compiling miniz_oxide v0.6.2 Compiling dasp_window v0.11.1 Compiling miow v0.3.7 Compiling hyper v0.14.23 Compiling enigo v0.0.14 (C:\Users\TGN\rustdesk\libs\enigo) Compiling impersonate_system v0.1.0 (https://github.com/21pages/impersonate-system#84b40189) Compiling runas v0.2.1 Compiling clipboard v0.1.0 (C:\Users\TGN\rustdesk\libs\clipboard) Compiling cpal v0.13.5 Compiling strum v0.24.1 Compiling widestring v1.0.2 Compiling time-macros v0.2.4 Compiling base64 v0.13.1 Compiling async-trait v0.1.59 Compiling sysinfo v0.24.7 Compiling rustls-pemfile v1.0.1 Compiling win-sys v0.3.1 Compiling mio-named-pipes v0.1.7 Compiling flate2 v1.0.25 Compiling dasp_signal v0.11.0 Compiling digest v0.10.6 Compiling windows v0.30.0 Compiling rdev v0.5.0-2 (https://github.com/fufesou/rdev#1be26c7e) Compiling miow v0.4.0 Compiling rayon v1.6.1 Compiling webpki v0.22.0 Compiling sct v0.7.0 Compiling time v0.3.9 Compiling webpki-roots v0.22.6 Compiling hbb_common v0.1.0 (C:\Users\TGN\rustdesk\libs\hbb_common) Compiling url v2.3.1 Compiling which v3.1.1 Compiling clipboard-win v4.4.2 Compiling serde_urlencoded v0.7.1 Compiling dasp_slice v0.11.0 Compiling rtoolbox v0.0.1 Compiling ansi_term v0.12.1 Compiling tokio-rustls v0.23.4 Compiling cpufeatures v0.2.5 Compiling widestring v0.4.3 Compiling ipnet v2.6.0 Compiling byteorder v1.4.3 Compiling hyper-rustls v0.23.2 Compiling block v0.1.6 Compiling debug-helper v0.3.13 Compiling memalloc v0.1.0 Compiling mime v0.3.16 Compiling default-net v0.11.0 (https://github.com/Kingtous/default-net#bdaad8dd) Compiling cidr-utils v0.5.9 Compiling trayicon v0.1.3-1 (https://github.com/open-trade/trayicon-rs#8d9c4489) Compiling reqwest v0.11.13 Compiling repng v0.2.2 Compiling windows-service v0.4.0 Compiling flexi_logger v0.22.6 Compiling sha2 v0.10.6 Compiling dasp v0.11.0 Compiling rpassword v7.2.0 Compiling arboard v2.1.1 Compiling parity-tokio-ipc v0.7.3-1 (https://github.com/open-trade/parity-tokio-ipc#20b28959) Compiling shared_memory v0.12.4 Compiling system_shutdown v3.0.0 Compiling wol-rs v0.9.1 Compiling errno v0.2.8 Compiling sys-locale v0.2.3 Compiling uuid v1.2.2 Compiling ctrlc v3.2.4 Compiling sciter-rs v0.5.57 (https://github.com/open-trade/rust-sciter?branch=dyn#82025b9b) Compiling whoami v1.2.3 Compiling shutdown_hooks v0.1.0 Compiling webm v1.0.2 Compiling zstd v0.9.2+zstd.1.5.1 Compiling virtual_display v0.1.0 (C:\Users\TGN\rustdesk\libs\virtual_display) warning: the type `DXGI_OUTDUPL_DESC` does not permit being left uninitialized --> libs\scrap\src\dxgi\mod.rs:61:33 | 61 | let mut desc = unsafe { mem::MaybeUninit::uninit().assume_init() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: integers must be initialized = note: `#[warn(invalid_value)]` on by default warning: the type `DXGI_OUTDUPL_FRAME_INFO` does not permit being left uninitialized --> libs\scrap\src\dxgi\mod.rs:179:24 | 179 | let mut info = mem::MaybeUninit::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: integers must be initialized warning: the type `DXGI_MAPPED_RECT` does not permit being left uninitialized --> libs\scrap\src\dxgi\mod.rs:188:24 | 188 | let mut rect = mem::MaybeUninit::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: integers must be initialized warning: the type `D3D11_TEXTURE2D_DESC` does not permit being left uninitialized --> libs\scrap\src\dxgi\mod.rs:207:32 | 207 | let mut texture_desc = mem::MaybeUninit::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: integers must be initialized warning: the type `winapi::um::wingdi::DISPLAY_DEVICEW` does not permit being left uninitialized --> libs\scrap\src\dxgi\mod.rs:365:51 | 365 | let mut d: DISPLAY_DEVICEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: integers must be initialized warning: the type `winapi::um::wingdi::DEVMODEW` does not permit being left uninitialized --> libs\scrap\src\dxgi\mod.rs:385:44 | 385 | let mut m: DEVMODEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: integers must be initialized warning: the type `winapi::shared::dxgi::DXGI_OUTPUT_DESC` does not permit being left uninitialized --> libs\scrap\src\dxgi\mod.rs:444:28 | 444 | let mut desc = mem::MaybeUninit::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: integers must be initialized warning: `scrap` (lib) generated 7 warnings Compiling rustdesk v1.2.0 (C:\Users\TGN\rustdesk) error[E0583]: file not found for module `version` --> src\lib.rs:25:1 | 25 | mod version; | ^^^^^^^^^^^^ | = help: to create the module `version`, create file "src\version.rs" or "src\version\mod.rs" error[E0432]: unresolved import `crate::VERSION` --> src\server\connection.rs:9:18 | 9 | use crate::{ipc, VERSION}; | ^^^^^^^ | | | no `VERSION` in the root | help: a similar name exists in the module: `version` error[E0425]: cannot find value `VERSION` in the crate root --> src\platform\windows.rs:985:38 | 985 | let versions: Vec<&str> = crate::VERSION.split(".").collect(); | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\platform\windows.rs:1144:24 | 1144 | version=crate::VERSION, | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\server\video_service.rs:96:39 | 96 | && get_version_number(&crate::VERSION) > get_version_number("1.1.9"); | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\client.rs:1464:29 | 1464 | version: crate::VERSION.to_string(), | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\rendezvous_mediator.rs:307:29 | 307 | version: crate::VERSION.to_owned(), | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\rendezvous_mediator.rs:357:29 | 357 | version: crate::VERSION.to_owned(), | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\rendezvous_mediator.rs:401:29 | 401 | version: crate::VERSION.to_owned(), | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\common.rs:514:21 | 514 | url: crate::VERSION.to_owned(), | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\common.rs:523:77 | 523 | if get_version_number(&version) > get_version_number(crate::VERSION) { | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\core_main.rs:70:31 | 70 | println!("{}", crate::VERSION); | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\ui_interface.rs:416:55 | 416 | let a = hbb_common::get_version_number(crate::VERSION); | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\ui_interface.rs:651:12 | 651 | crate::VERSION.to_owned() | ^^^^^^^ not found in the crate root error[E0425]: cannot find value `VERSION` in the crate root --> src\hbbs_http\sync.rs:57:80 | 57 | v["ver"] = json!(hbb_common::get_version_number(crate::VERSION)); | ^^^^^^^ not found in the crate root warning: unused import: `crate::ui_interface::using_public_server` --> src\ui_session_interface.rs:9:5 | 9 | use crate::ui_interface::using_public_server; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default Some errors have detailed explanations: E0425, E0432, E0583. For more information about an error, try `rustc --explain E0425`. warning: `rustdesk` (lib) generated 1 warning error: could not compile `rustdesk` due to 15 previous errors; 1 warning emitted PS C:\Users\TGN\rustdesk> rustup default stable-x86_64-pc-windows-msvc (default) PS C:\Users\TGN\rustdesk> ``` Thanks in advantage
deekerman 2026-02-20 23:23:01 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tognols commented on GitHub (Jan 27, 2023):

I have managed to build rustdesk with
python3 .\build.py
From the root directory.

I thought that for development I should have used cargo run to produce target/debug.

It may seem obvious but I found it kinda unintuitive since it is stated that build.py should be used to produce the final executables and not for debugging purposes.

@tognols commented on GitHub (Jan 27, 2023): I have managed to build rustdesk with ``` python3 .\build.py ``` From the root directory. I thought that for development I should have used cargo run to produce target/debug. It may seem obvious but I found it kinda unintuitive since it is stated that build.py should be used to produce the final executables and not for debugging purposes.
Author
Owner

@rustdesk commented on GitHub (Jan 27, 2023):

#763

@rustdesk commented on GitHub (Jan 27, 2023): #763
Author
Owner

@hax10 commented on GitHub (Jan 31, 2023):

I came across a similar problem building the newest master branch on Linux. I worked around it by adding this line in src/main.rs before the main function:

// add a version number so that other parts of the code that require it don't  panic
static VERSION: u32 = 3;

I'm pretty sure this isn't the proper way to solve the problem, but it works.

@hax10 commented on GitHub (Jan 31, 2023): I came across a similar problem building the newest master branch on Linux. I worked around it by adding this line in ```src/main.rs``` before the main function: ```rust // add a version number so that other parts of the code that require it don't panic static VERSION: u32 = 3; ``` I'm pretty sure this isn't the proper way to solve the problem, but it works.
Author
Owner

@suzp1984 commented on GitHub (Jan 31, 2023):

Meet the same issue on Mac OS.
My solution:

add src/version.rs with the following content.

pub static VERSION: &str = "1.2.0";
@suzp1984 commented on GitHub (Jan 31, 2023): Meet the same issue on Mac OS. My solution: add `src/version.rs` with the following content. ``` pub static VERSION: &str = "1.2.0"; ```
Author
Owner

@hax10 commented on GitHub (Jan 31, 2023):

It looks like this is fixed in the latest master by PR #2963

Originally, the Cargo build script would (re-)generate src/version.rs automatically for release builds but not for debug or any other ones. Now it (re-)generates for all circumstances.

@hax10 commented on GitHub (Jan 31, 2023): It looks like this is fixed in the latest master by PR #2963 Originally, the Cargo build script would (re-)generate ```src/version.rs``` automatically for release builds but not for debug or any other ones. Now it (re-)generates for all circumstances.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#1291
No description provided.