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

stderr error: header 'steam_gameserver.h' does not exist. #62

Closed
podrivo opened this issue Jul 6, 2021 · 2 comments
Closed

stderr error: header 'steam_gameserver.h' does not exist. #62

podrivo opened this issue Jul 6, 2021 · 2 comments

Comments

@podrivo
Copy link

podrivo commented Jul 6, 2021

Hello! @Noxime

I'm trying to build Rust in Windows and macOS, but when compiling steamworks-sys, I get this:

error: failed to run custom build command for `steamworks-sys v0.7.0`

Caused by:
  process didn't exit successfully: `/Library/WebServer/Documents/hello_world/target/debug/build/steamworks-sys-76cbcb8d9f2d24c2/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=/sdk/redistributable_bin/osx
  cargo:rustc-link-lib=dylib=steam_api

  --- stderr
  error: header '/sdk/public/steam/steam_gameserver.h' does not exist.
  thread 'main' panicked at 'Unable to generate bindings: ()', /Users/podrivo/.cargo/registry/src/github.com-1ecc6299db9ec823/steamworks-sys-0.7.0/build.rs:49:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Testing on:

  • macOS Catalina 10.15.7
  • Windows 10
  • Rust 1.53.0
  • clang version 12.0.0
  • Steam SDK 1.51

I'm running this command to build (without the SDK STEAM_SDK_LOCATION env var in Windows):

STEAM_SDK_LOCATION=/sdk/ cargo build

This is my Cargo.toml:

[package]
name = "hello_world"
version = "0.1.0"

[dependencies]
steamworks = "0.7.0"

And this is my folder structure:

hello_world
├── sdk
├── src
│   └── main.rs
├── Cargo.toml
└── steam_appid.txt

Thoughts on why this is happening?
Thank you!

@podrivo podrivo changed the title OSX Error can't find header OSX stderr error: header 'steam_gameserver.h' does not exist. Jul 6, 2021
@podrivo podrivo changed the title OSX stderr error: header 'steam_gameserver.h' does not exist. stderr error: header 'steam_gameserver.h' does not exist. Jul 7, 2021
@Noxime
Copy link
Owner

Noxime commented Jul 9, 2021

Sorry for taking a while! This is a shot in the dark, are you sure your STEAM_SDK_LOCATION is correct? In the command you posted you have STEAM_SDK_LOCATION=/sdk/. On MacOS and other *nix operating systems when a path starts with a / it means its from the filesystem root, so what you probably wanted was just sdk/ or ./sdk/ which will refer to the folder sdk in current folder.

@podrivo
Copy link
Author

podrivo commented Jul 10, 2021

Hey @Noxime. No problem at all! Thanks for having the time! 😄

Yes, you are correct! I tried multiple ways to link to the SDK folder, like /sdk/ sdk/ ./sdk ./sdk/, but it seems like all options couldn't find the SDK files and gave the same error. So I moved it to my Desktop and updated the env var to STEAM_SDK_LOCATION="$HOME/Desktop/sdk" and the build worked!

I thought this was related to the macOS, because you can find multiple threads about missing headers in Catalina 10.15, but even thought I tried every single solution I could find, I got the same error every build. And when I went to the Windows to test it and got the same exact error, I decided to ask for help... 😅

Also, I had to reinstall llvm with brew, and update llvm/bin to $PATH and set $LDFLAGS and $CPPFLAGS, as suggested by brew installer and just like this issue: #52

I can't make it run, though. But I'll open a separate issue for this! (:
Thanks for the help! ✨

@podrivo podrivo closed this as completed Jul 10, 2021
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