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

example_bot build fail #2

Closed
Evgene-Kopylov opened this issue Jul 18, 2022 · 5 comments
Closed

example_bot build fail #2

Evgene-Kopylov opened this issue Jul 18, 2022 · 5 comments

Comments

@Evgene-Kopylov
Copy link

Fail to build example_bot. Standard recomended Rust install config, Win 11, 64-bit,

Error log

Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\Death\Desktop\Botnet\botnet> cargo build --release --manifest-path=example_bot/Cargo.toml
    Updating crates.io index
  Downloaded getrandom v0.2.7
  Downloaded proc-macro2 v1.0.39
  Downloaded rend v0.3.6
  Downloaded rkyv_derive v0.7.38
  Downloaded ptr_meta_derive v0.1.4
  Downloaded seahash v4.1.0
  Downloaded quote v1.0.19                                                                                                                                                                                                  
  Downloaded unicode-ident v1.0.1                                                                                                                                                                                           
  Downloaded serde_derive v1.0.137                                                                                                                                                                                          
  Downloaded serde v1.0.137                                                                                                                                                                                                 
  Downloaded syn v1.0.98                                                                                                                                                                                                    
  Downloaded version_check v0.9.4                                                                                                                                                                                           
  Downloaded bincode v1.3.3                                                                                                                                                                                                 
  Downloaded rkyv v0.7.38                                                                                                                                                                                                   
  Downloaded once_cell v1.12.0                                                                                                                                                                                              
  Downloaded hashbrown v0.12.1
  Downloaded ptr_meta v0.1.4                                                                                                                                                                                                
  Downloaded cfg-if v1.0.0                                                                                                                                                                                                  
  Downloaded bytecheck_derive v0.6.8
  Downloaded bytecheck v0.6.8                                                                                                                                                                                               
  Downloaded ahash v0.7.6
  Downloaded 21 crates (897.6 KB) in 1.65s                                                                                                                                                                                  
   Compiling example_bot v0.1.0 (C:\Users\Death\Desktop\Botnet\botnet\example_bot)
error: linking with `link.exe` failed: exit code: 1120                                                                                                                                                                      
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\link.exe" "/DEF:C:\\Users\\Death\\AppData\\Local\\Temp\\rustcs6hVu6\\lib.def" "/NOLOGO" "C:\\
Users\\Death\\AppData\\Local\\Temp\\rustcs6hVu6\\symbols.o" "C:\\Users\\Death\\Desktop\\Botnet\\botnet\\example_bot\\target\\release\\deps\\example_bot.example_bot.007f73e9-cgu.4.rcgu.o" "/LIBPATH:C:\\Users\\Death\\Deskto
p\\Botnet\\botnet\\example_bot\\target\\release\\deps" "/LIBPATH:C:\\Users\\Death\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Death\\.rustup\\toolchains\\sta
ble-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-6f60f6a23a58b163.rlib" "bcrypt.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "msvcrt.lib" "/NXCOMPAT
" "/LIBPATH:C:\\Users\\Death\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:C:\\Users\\Death\\Desktop\\Botnet\\botnet\\example_bot\\target\\release\\deps\\example_bot
.dll" "/OPT:REF,ICF" "/DLL" "/IMPLIB:C:\\Users\\Death\\Desktop\\Botnet\\botnet\\example_bot\\target\\release\\deps\\example_bot.dll.lib" "/DEBUG" "/NATVIS:C:\\Users\\Death\\.rustup\\toolchains\\stable-x86_64-pc-windows-ms
vc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Death\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Death\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\Death\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note:    Creating library C:\Users\Death\Desktop\Botnet\botnet\example_bot\target\release\deps\example_bot.dll.lib and object C:\Users\Death\Desktop\Botnet\botnet\example_bot\target\release\deps\example_bot.dll.exp   
          example_bot.example_bot.007f73e9-cgu.4.rcgu.o : error LNK2019: unresolved external symbol __log_debug referenced in function __tick
          example_bot.example_bot.007f73e9-cgu.4.rcgu.o : error LNK2019: unresolved external symbol __deposit_resource referenced in function __tick
          example_bot.example_bot.007f73e9-cgu.4.rcgu.o : error LNK2019: unresolved external symbol __harvest_resource referenced in function __tick
          example_bot.example_bot.007f73e9-cgu.4.rcgu.o : error LNK2019: unresolved external symbol __move_towards referenced in function __tick
          C:\Users\Death\Desktop\Botnet\botnet\example_bot\target\release\deps\example_bot.dll : fatal error LNK1120: 4 unresolved externals


error: could not compile `example_bot` due to previous error
PS C:\Users\Death\Desktop\Botnet\botnet> 
@JMS55
Copy link
Owner

JMS55 commented Jul 18, 2022

You need to build the example bot for the wasm32-unknown-unknown target. Running cargo build inside the example_bot directory should automatically set the correct target, but apparently that does not work when running with --manifest-path. I've updated the readme with new instructions to fix this. Please try it and let me know if you can get it to compile now.

@Evgene-Kopylov
Copy link
Author

rustup target add wasm32-unknown-unknown 
cd example_bot
cargo build

compiled.

next is

\botnet> cargo build

or

> cargo build --release --manifest-path=botnet/Cargo.toml

results in

   Compiling botnet v0.1.0 (C:\Users\Death\Desktop\Botnet\botnet\botnet)
error: couldn't read src\../../example_bot/target/wasm32-unknown-unknown/release/example_bot.wasm: The system cannot find the path specified. (os error 3)                                                                  
  --> src\game.rs:41:21
   |
41 | /                     include_bytes!(
42 | |                         "../../example_bot/target/wasm32-unknown-unknown/release/example_bot.wasm"
43 | |                     ),
   | |_____________________^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `botnet` due to previous error   

@JMS55
Copy link
Owner

JMS55 commented Jul 19, 2022

You need to compile the example bot in release, or change that include_bytes path to /debug/.

@Evgene-Kopylov
Copy link
Author

Evgene-Kopylov commented Jul 19, 2022

cargo build --release --manifest-path=botnet/Cargo.toml
compiled

Attempt to run server
RUST_LOG=botnet cargo run --manifest-path=botnet/Cargo.toml

PS C:\Users\Death\Desktop\Botnet\botnet> RUST_LOG=botnet cargo run --manifest-path=botnet/Cargo.toml
RUST_LOG=botnet : The term 'RUST_LOG=botnet' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct 
and try again.
At line:1 char:1
+ RUST_LOG=botnet cargo run --manifest-path=botnet/Cargo.toml
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (RUST_LOG=botnet:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

@JMS55
Copy link
Owner

JMS55 commented Jul 20, 2022

RUST_LOG=botnet is how you set an environment variable for a command in linux. I'm not sure what the powershell equivalent would be, but you should be able to find the info on the internet.

@JMS55 JMS55 closed this as completed Jul 24, 2022
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