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

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

Open
zatmos opened this issue Jun 4, 2022 · 7 comments
Labels

Comments

@zatmos
Copy link

zatmos commented Jun 4, 2022

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 zatmos added the bug label Jun 4, 2022
@zatmos zatmos changed the title Compilation failure: "Could not find native static library SDL2main" on Gentoo Compilation failure: "Could not find native static library \SDL2main\" on Gentoo Jun 4, 2022
@zatmos zatmos changed the title Compilation failure: "Could not find native static library \SDL2main\" on Gentoo Compilation failure: "Could not find native static library SDL2main" on Gentoo Jun 4, 2022
@rzerres
Copy link
Contributor

rzerres commented Jun 4, 2022

@zatmos
did you check to run with

cargo run --example showcase --features bundled

as stated in the README?

@zatmos
Copy link
Author

zatmos commented Jun 5, 2022

@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.

@ghost
Copy link

ghost commented Jun 27, 2022

On NixOS same problem

@adsick
Copy link

adsick commented Sep 29, 2022

same on Fedora (tried to compile Sodium)

@ItalicIntegral
Copy link

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.

@adsick
Copy link

adsick commented Oct 3, 2022

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

@zatmos
Copy link
Author

zatmos commented Oct 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants