Tonic: hello_world example is fails with environment variable `OUT_DIR` not defined

Created on 15 Apr 2020  路  1Comment  路  Source: hyperium/tonic

Have tried hello world example from here

Got an error:

error: environment variable `OUT_DIR` not defined
--> src/server.rs:21:5
|
21 |     tonic::include_proto!("helloworld");
|     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Windows 10 64bit

[dependencies]
tonic = "0.2.0"
prost = "0.6.1"
tokio = { version = "0.2.18", features = ["macros"] }

[build-dependencies]
tonic-build = "0.2.0"

Maybe it is windows-only bug?
I have made everything step by step like in example

Can you also help, explain how I need to set OUT_DIR variable and which path have to provide (If I have to)
Forward thank you

Most helpful comment

I just have put build.rs file is src/ folder instead of root. That was a mistake.
Maybe this silly issue will help somebody as green as I am))

>All comments

I just have put build.rs file is src/ folder instead of root. That was a mistake.
Maybe this silly issue will help somebody as green as I am))

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pranjalssh picture pranjalssh  路  4Comments

LucioFranco picture LucioFranco  路  6Comments

LucioFranco picture LucioFranco  路  7Comments

rokadias picture rokadias  路  4Comments

scottlamb picture scottlamb  路  5Comments