You are not logged in.

#1 2016-07-17 17:08:47

dogjaw2233
Member
Registered: 2016-07-17
Posts: 4

[SOLVED] is the SDL_image.a file missing?

Basicly i was running throught a tutorial on sdl in c++. i was trying to use

hello = SDL_Load("arch.png");

at one point to load a png image. this function is included in SDL_image. I added the correct header but still this happened:

GCC wrote:

fatal error: SDL/SDL_image.so: No such file or directory|

I saw that the libsdl_image.a file was missing and according to package search is not included in the package. is this intentional?

Last edited by dogjaw2233 (2016-07-20 17:01:49)

Offline

#2 2016-07-17 17:17:31

headkase
Member
Registered: 2011-12-06
Posts: 2,008

Re: [SOLVED] is the SDL_image.a file missing?

If you're not wedded to SDL then there is SFML which is just as portable as SDL and is in the official repos.  SFML is primarily 2D only but you can get an OpenGL context out of it if you want.  The library doesn't give you much more than that though for OpenGL.  For 2D it's a great library.

Last edited by headkase (2016-07-17 17:19:54)

Offline

#3 2016-07-17 17:37:53

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] is the SDL_image.a file missing?

See the sdl_image package.

A .so file is not a static library.

Offline

#4 2016-07-18 10:15:05

dogjaw2233
Member
Registered: 2016-07-17
Posts: 4

Re: [SOLVED] is the SDL_image.a file missing?

brebs wrote:

See the sdl_image package.

A .so file is not a static library.

What am i looking for in the sdl_image package? and how would i go about compiling with a shared object?

Offline

#5 2016-07-18 12:59:12

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,615

Re: [SOLVED] is the SDL_image.a file missing?

Do you have sdl_image installed ?

you get that error when trying to compile with gcc ?
please post the full output .

Something i find weird : the file should be called libSDL_image.so .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2016-07-18 14:21:20

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: [SOLVED] is the SDL_image.a file missing?

Lazy Foo Productions has a great deal of SDL 1 and 2 tutorials. This is how I learned SDL before switching to SFML. Good luck! big_smile


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#7 2016-07-18 21:03:38

dogjaw2233
Member
Registered: 2016-07-17
Posts: 4

Re: [SOLVED] is the SDL_image.a file missing?

JohnBobSmith wrote:

Lazy Foo Productions has a great deal of SDL 1 and 2 tutorials. This is how I learned SDL before switching to SFML. Good luck!

Thanks! ill give that a look.

Lone_Wolf wrote:

Do you have sdl_image installed ?

you get that error when trying to compile with gcc ?
please post the full output .

Something i find weird : the file should be called libSDL_image.so .

I get it when compiling with GCC. the headers are:

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

It just spits out a file not found error if i dont include the "SDL/".

The location and name of the .so is: "usr/lib64/libSDL_image.so"

The full output is:

GCC wrote:

||=== Build: Debug in fgh (compiler: GNU GCC Compiler) ===|
/home/dogjaw2233/projects/fgh/main.cpp||In function ‘int main(int, char**)’:|
/home/dogjaw2233/projects/fgh/main.cpp|13|error: ‘SDL_Load’ was not declared in this scope|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Offline

#8 2016-07-19 12:33:13

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,615

Re: [SOLVED] is the SDL_image.a file missing?

hello = SDL_Load("arch.png");

dogjaw2233, i think the error is that SDL_Load   is not  a valid function.
SDL appears to have a SDL_LoadBMP() function for BMP graphics , and also a IMG_Load() function that can handle many graphic formats.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2016-07-20 17:01:33

dogjaw2233
Member
Registered: 2016-07-17
Posts: 4

Re: [SOLVED] is the SDL_image.a file missing?

Thank you lone_wolf. that worked perfectly!

Offline

Board footer

Powered by FluxBB