redox-os/orbtk

Compilation failure: "Could not find native static library `SDL2main`" on Gentoo

zatmos opened this issue · 7 comments

Describe the bug
When adding orbtk as a dependency to a new Rust project and trying to compile it on Gentoo, the compilation fails with

error: could not find native library `SDL2main`, perhaps an -L flag is missing?

error: could not compile `sdl2-sys` due to previous error

To Reproduce
Enter the following commands on Gentoo:

$ cargo new orbtk-test
$ cd orbtk-test
$ echo 'orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" }' >> Cargo.toml
$ cargo run

Compilation then fails.

Expected behavior
The project should compile and display the "Hello, world!" string.

Desktop

  • OS: Gentoo Linux
  • Rust version: Rust 1.61.0

Additional context

  • media-libs/libsdl2 is present and compiled with the "static-libs" use flag.
  • Creating a new project and setting sdl2 as a Cargo dependency on its own works fine, same with sdl2-sys.
  • Also tried on Linux Mint and this issue doesn't happen there.

@zatmos
did you check to run with

cargo run --example showcase --features bundled

as stated in the README?

@rzerres
I did and it still fails to compile with the same error.
On Linux Mint, it does compiles but only displays a black window which isn't normal but also unrelated to this issue.

On NixOS same problem

same on Fedora (tried to compile Sodium)

I had the same issue on Pop Os. When I read the error message carefully it also mentioned that I did not have cmake.

Here is what I did..
sudo apt-get install libsdl2-dev
sudo apt install cmake

After that the first orbtk example compiles and the orbtk-template. However, I can see the tile block but not text boxes.

@ItalicIntegral my system has cmake and still... I looked up what is needed to build sdl2 here, but don't see what is missing.

@ItalicIntegral I can confirm that I have cmake installed as well.