Ask coding questions

← Back to all posts
Does repl.it have the SDL_Image library or the SDL2_Image library?
Terra361 (6)

I was wondering if repl.it has the SDL_Image or SDL2_Image libraries. I assumed they did, but I can't exactly be sure, since there's tons of ways the files could vary. Also, do they have any other libraries like SDL_Image?

Comments
hotnewtop
CrazyVideoGamer (12)

You can try to do install-pkg libsdl2-image-dev, which will install SDL_image

ucax217 (0)

If it helps, I have a simple env with SDL2_image and SDL2_ttf compiled
https://repl.it/join/nfwfdsos-ucax217

RYANTADIPARTHI (6020)

I think there's another way to do it in repl.it, but probably won't work for now. Might want to use something else for that.

Coder100 (18890)

why not just test it out?

Terra361 (6)

@Coder100 I did try, but I don't know exactly how to link it with the compiler. Or include the file. Because I don't know what to type, not that I don't know how to use #include or -l(insertfilenamehere).

Terra361 (6)

@Coder100 I do seem to ask a lot, don't I?

programmeruser (615)

@Terra361 first you'll have to download the shared or static library, then the header, and then link to the shared/static library (I mean "dynamic" not "shared").

Coder100 (18890)

i think its bundled inside the folder @programmeruser

Terra361 (6)

@programmeruser I don't think I can DO that in repl, though.

Terra361 (6)

@Coder100 I typed that in but it's marked with a red line.

programmeruser (615)

@Terra361 that's because you have to install it separately I think

programmeruser (615)

@Terra361 SPQR said he couldn't get SDL_Image to work

Coder100 (18890)

doesn't mean it doesn't work @Terra361

Terra361 (6)

@programmeruser SPQR said that a really long time ago; I would think that since that was when he still had to use makefile to get SDL or SDL2, and that both of those are now on repl.it (not needing makefile), repl.it should have the Image counterparts of those.

Terra361 (6)

@Coder100 SDL2/SDL_image: no such file or directory

Terra361 (6)

@Coder100 install-pkg sdl what does this do?
Oh, it imports SDL.

Coder100 (18890)

lol yeah instead of sudo apt-get we have install-pkg @Terra361

Terra361 (6)

@Coder100 It almost worked, just two errors.

Terra361 (6)

@Coder100 w:--force-yes is deprecated, use --allow instead
E:unable to locate package sdl
ls: cannot access /tmp//apt/cache/archives/*.deb: no such file or directory

Terra361 (6)

@Coder100 then again, maybe it didn't almost work. Also, I counted wrong. three errors.

Terra361 (6)

@Coder100 I found something! SDL/SDL_image.h works in #include. Now I am going to find SDL2_image, because obviously if they installed the first _image they would install the second.

Terra361 (6)

@Coder100 Do you have any ideas?

Coder100 (18890)

i tried all 4 possibilities :(
just see if the v1 is compatible @Terra361

Terra361 (6)

@Coder100 'Tis not. I'll try to recreate the library, maybe I can get the repl.it people to install it.

Terra361 (6)

@Coder100 Should I use polygott?
I should probably use polygott.

Terra361 (6)

@Coder100 Makefile syntax. Useful for a static library.

Coder100 (18890)

@Terra361 eh, a .replit file should suffice

Terra361 (6)

@Coder100 Oh, okay. I already have that, but the only thing I know how to do with .replit files is add headers to the compiler sequence.

Coder100 (18890)

i mean you could do make as your run command and it would act 'like' polygott. @Terra361

Terra361 (6)

@Coder100 Oh. Okay. I need to learn more of this stuff. I'm pretty sure .replit files are handy.

Coder100 (18890)

@Terra361 they are, I use them for almost all my C++ projects (or I just use bash lel)

Terra361 (6)

@Coder100 Do you know of any tutorial for using them? I need to learn how first.

Terra361 (6)

@Coder100 I didn't realize it was makefile.
I = stupid(at times);

Terra361 (6)

@Coder100 I have decided I'll just make my own library. That way I can make the library easier, or more powerful.

Terra361 (6)

@Coder100 Thanks. Do you want me to tell you when it's finished?

Terra361 (6)

@Coder100 Should the library be based on game creating? Or should it be made for other uses too?

bily102 (0)

@Terra361 maybe u should just find a substitute instead of trying to recreate the wheel. install-pkg sdl worked for me :)

bily102 (0)

@bily102 sry I ment install-pkg libsdl2-image-dev