Skip to content
← Back to Community
Does repl.it have the SDL_Image library or the SDL2_Image library?
Profile icon
Terra361

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?

Voters
Profile icon
hg0428
Profile icon
Terra361
Comments
hotnewtop
Profile icon
CrazyVideoGamer

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

Profile icon
JadenTheDev

DDD

Profile icon
ucax217

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

Profile icon
RYANTADIPARTHI

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.

Profile icon
Coder100

why not just test it out?

Profile icon
Terra361

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

Profile icon
Terra361

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

Profile icon
programmeruser

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

Profile icon
Coder100

i think its bundled inside the folder @programmeruser

Profile icon
Coder100
#include "SDL2/SDL_image.h"

@programmeruser

Profile icon
Terra361

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

Profile icon
Terra361

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

Profile icon
programmeruser

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

Profile icon
programmeruser

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

Profile icon
Coder100

doesn't mean it doesn't work @Terra361

Profile icon
Coder100

try runnign i t @Terra361

Profile icon
Coder100

install-pkg sdl @programmeruser

Profile icon
Terra361

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

Profile icon
Terra361

@Coder100 SDL2/SDL_image: no such file or directory

Profile icon
Terra361

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

Profile icon
Coder100

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

Profile icon
Terra361

@Coder100 It almost worked, just two errors.

Profile icon
Coder100

yay what are they? @Terra361

Profile icon
Terra361

@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

Profile icon
Terra361

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

Profile icon
Terra361

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

Profile icon
Coder100

@Terra361 yay gl!

Profile icon
Terra361

@Coder100 Do you have any ideas?

Profile icon
Coder100

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

Profile icon
Terra361

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

Profile icon
Terra361

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

Profile icon
Coder100

um... why? @Terra361

Profile icon
Terra361

@Coder100 Makefile syntax. Useful for a static library.

Profile icon
Coder100

@Terra361 eh, a .replit file should suffice

Profile icon
Terra361

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

Profile icon
Coder100

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

Profile icon
Terra361

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

Profile icon
Coder100

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

Profile icon
Terra361

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

Profile icon
Coder100
Profile icon
Terra361

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

Profile icon
Terra361

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

Profile icon
Coder100

@Terra361 wow! Good luck!

Profile icon
Terra361

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

Profile icon
Coder100

@Terra361 yes please :)

Profile icon
Terra361

Okay.

Profile icon
Terra361

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

Profile icon
bily102

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

Profile icon
bily102

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