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

Fail to build sdl2-Sys on x86_64-pc-windows-msvc #954

Closed
jstefanelli opened this issue Dec 30, 2019 · 3 comments
Closed

Fail to build sdl2-Sys on x86_64-pc-windows-msvc #954

jstefanelli opened this issue Dec 30, 2019 · 3 comments

Comments

@jstefanelli
Copy link

Hi,
on and off for the last few months I've tried to set up sdl2 on rust. While on linux and mac it as easy as creating this Cargo.toml and running cargo build, on windows I fail consistently with the following error messages: error.txt

The lines that I think matter are the following:

     Creating library H:/HD/Documernts/sdlTest/target/debug/build/sdl2-sys-128904f9eb441901/out/build/Release/SDL2.lib and object H:/HD/Documernts/sdlTest/target/debug/build/sdl2-sys-128904f9eb441901/out/build/Release/SDL2.exp
SDL_string.obj : error LNK2019: unresolved external symbol memset referenced in function SDL_vsnprintf_REAL [H:\HD\Documernts\sdlTest\target\debug\build\sdl2-sys-128904f9eb441901\out\build\SDL2.vcxproj]
H:\HD\Documernts\sdlTest\target\debug\build\sdl2-sys-128904f9eb441901\out\build\Release\SDL2.dll : fatal error LNK1120: 1 unresolved externals [H:\HD\Documernts\sdlTest\target\debug\build\sdl2-sys-128904f9eb441901\out\build\SDL2.vcxproj]

I've tried with running cargo build from powershell and the VS 2019 Command prompt with no difference.
I'm retty sure I missed a step in the configuration. Any help is appreciated, thanks!

@Cobrand
Copy link
Member

Cobrand commented Dec 30, 2019

Does it still fail without using the "bundled" feature? Does it compile fine on the "master" branch of sdl2?

@Cobrand
Copy link
Member

Cobrand commented Dec 30, 2019

I thin your problem is https://stackoverflow.com/questions/58288692/cant-build-solution-in-release-mode-for-sdl-library-on-vs-2019, which is solved by #951 , so try using in your Cargo.toml

sdl2 = { git = "https://github.com/Rust-SDL2/rust-sdl2.git" }

It will also be included in 0.33 if you can wait.

@jstefanelli
Copy link
Author

Can confirm targeting git works. Thank you so much!

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