#help for sdl2 library

1 messages · Page 1 of 1 (latest)

frozen vale
#

everytime I try to compile a rust file which contains like a sdl2 rust crate it gives me this error. example :I tried just casually cloning a repo which used sdl and I got this error when I compiled the program. Anyone could suggest me how to solve?

#

It also gives this above

hollow lotus
#

Install sdl2

#

SDL is a separate library

frozen vale
#

where

#

installed the latest still get error

kind shell
#

I see you're using windows.
How did you "install" sdl2?
It's a bit more tricky on windows, since it doesn't have a global lib path like /usr/lib on *nix

#

You might need to add the path where you installed it as a library search path

paper orbit
kind shell
#

Well, you can't exactly "install" a zip file

#

Just extract it

frozen vale
#

Yeah I meant that

kind shell
#

But the linker would need to know where you extracted the zip

#

But before that, check out the suggestion by @paper orbit

#

It will probably make your life easier

frozen vale
#

How do I access this ? it says it is not possibile to find this path

#

@kind shell

kind shell
#

Don't absolute paths begin with a drive letter on windows?
So C:\Program Files\...
You might also want to wrap the path in double quotes as well.

#

But definitely check out the advice above

frozen vale
#

yeah I've been following that

kind shell
#

Did you try using the bundled feature?

frozen vale
#

No I don't really understand that

kind shell
#

[dependencies. sdl2]
version = ...
features = ["bundled"]

paper orbit
frozen vale
#

and then compile

paper orbit
#

Yea use the latest version if you can

frozen vale
#

gives this

kind shell
#

oof

#

Welp, as a last resort you could try using a different library, like macroquad for example

#

It's probably easier to build since it's pure rust

frozen vale
#

idk cause I was trying to run a cloned repo

#

isn't there a solution

kind shell
#

There probably is, but I'm out of ideas, sorry, haha.

frozen vale
#

oh ok no problem

frozen vale
#

I need to put the files here right? from the zip file

#

@paper orbit

paper orbit
#

Can you give the full error from using bundled

#

Your problem might be that you're missing a C compiler since the bundled feature requires one to complete sdl2 from source

#

The easiest way to get one would probably be downloading the Visual Studio installer and only installing the Visual Studio Build Tools

frozen vale
#

@paper orbit

paper orbit
#

Yup, see near the end of the screenshot it says "failed to execute command: program not found"

frozen vale
#

so all I needed was cmake ? @paper orbit

#

omg

paper orbit
#

Maybe 😅

frozen vale
#

yeah it was just cmake

#

thanks to y'all

paper orbit
#

Happy to help

frozen vale
#

nvm if I try running a normal sdl window it can compile but if I try compiling a chip 8 program I can't

paper orbit
#

Not familiar with chip8, what difference is there in that complication process

#

And does it return an error?

frozen vale
paper orbit
#

Can you post a screenshot of the whole thing?

frozen vale
#

gives this

#

but bigger

#

I can't screen

#

this under it

paper orbit
#

So what what did you have to change to cause it to stop working (from where we resolved it before)

frozen vale
#

I didn't change anything

#

if I try running an other program that crates a normal windowd with sdl it compiles

#

hm