You are not logged in.

#1 2013-09-17 20:53:04

Isaac Horvath
Member
Registered: 2012-12-29
Posts: 5

mingw32-sdl_image does not have jpg support

Hello,

I'm trying to cross-compile some basic SDL programs to Windows. I've tried installing mingw32-sdl_image from the AUR multiple times, but when I compile my programs for Windows and then run them under wine they give the error (via IMG_GetError): "Unsupported image format". I'm pretty sure I'm linking everything correctly. Here's my makefile:

CFLAGS = -Wall -pedantic -Werror
LFLAGS = -lSDL -lSDL_image
OBJS   = init.o input.o graphics.o main.o
PROG = tutorial02.exe
CXX = i486-mingw32-gcc

# top-level rule to create the program.
all: $(PROG)

# compiling other source files.
%.o: src/%.c src/%.h src/defs.h
	$(CXX) $(CFLAGS) -c -s $<

# linking the program.
$(PROG): $(OBJS)
	$(CXX) $(OBJS) -o $(PROG) $(LFLAGS)

# cleaning everything that can be automatically recreated with "make".
clean:
	rm $(PROG) *.o

Compiling this for Linux with a similar makefile (i486-mingw32-gcc is changed to gcc) seems to make an executable that can display the image fine. I figure the problem is that mingw32-sdl_image doesn't have jpg support built in or somehow it isn't linked when it's configured and compiled. Does anyone know how to fix this?

Thanks in advance,
Isaac

Offline

#2 2013-09-18 11:17:59

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

Re: mingw32-sdl_image does not have jpg support

./configure for mingw32-sdl_image

  ./configure --host=i486-mingw32 \
  --prefix=/usr/i486-mingw32 \
  --enable-static \
  --enable-shared \
  --disable-png-shared \
  --disable-webp --disable-webp-shared

./configure in extra/sdl_image :

  ./configure --prefix=/usr --disable-static

You could try changing the mingw32-sdl_image pkgbuild, or contact the maintainer to find out why they disabled png and webp .


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

Board footer

Powered by FluxBB