Jump to content
  • Advertisement
Sign in to follow this  

Linking against SDL_gfx using mingw (msys)?

This topic is 4494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is a "solution" post. If you are using mingw (msys) to compile SDL_gfx, the included makefile will only generate the .la and .a files, but not the needed .dll and .dll.a files. This will allow you to "link" against the .la and .a files, but it won't find the DLL specified versions of the functions, so it will give you error messages. To generate the .dll and .dll.a, use a makefile like this: CC = gcc AR=ar rc RANLIB=ranlib prefix=/usr/local bin_dir=$(prefix)/bin include_dir=$(prefix)/include lib_dir=$(prefix)/lib CFLAGS = -O3 -march=athlon-xp -mmmx -msse -m3dnow -DBUILD_DLL -DWIN32 -I/usr/local/include/SDL LIBS = -L/usr/local/lib -lSDL OBJS = SDL_framerate.o SDL_gfxPrimitives.o SDL_imageFilter.o SDL_rotozoom.o STATIC_LIB=libSDL_gfx.a IMPORT_LIB=libSDL_gfx.dll.a SHARED_LIB=SDL_gfx.dll all: $(STATIC_LIB) $(SHARED_LIB) $(STATIC_LIB): $(OBJS) $(AR) $@ $^ $(RANLIB) $@ $(SHARED_LIB): $(OBJS) gcc -s -shared -o $@ $^ -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(IMPORT_LIB) $(LIBS) test: $(SHARED_LIB) $(STATIC_LIB) Test/TestFramerate.exe Test/TestFonts.exe Test/TestGfxPrimitives.exe Test/TestImageFilter.exe Test/TestRotozoom.exe Test/TestFramerate.exe: Test/TestFramerate.c gcc -c $^ -o Test/TestFramerate.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL gcc -o $@ Test/TestFramerate.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL Test/TestFonts.exe: Test/TestFonts.c gcc -c $^ -o Test/TestFonts.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL gcc -o $@ Test/TestFonts.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL Test/TestGfxPrimitives.exe: Test/TestGfxPrimitives.c gcc -c $^ -o Test/TestGfxPrimitives.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL gcc -o $@ Test/TestGfxPrimitives.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL Test/TestImageFilter.exe: Test/TestImageFilter.c gcc -c $^ -o Test/TestImageFilter.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL gcc -o $@ Test/TestImageFilter.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL Test/TestRotozoom.exe: Test/TestRotozoom.c gcc -c $^ -o Test/TestRotozoom.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL gcc -o $@ Test/TestRotozoom.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL install: $(STATIC_LIB) $(SHARED_LIB) cp $(STATIC_LIB) $(SHARED_LIB) $(IMPORT_LIB) $(lib_dir) cp SDL_framerate.h SDL_gfxPrimitives.h SDL_imageFilter.h SDL_rotozoom.h $(include_dir)/SDL uninstall: rm -f $(lib_dir)/$(STATIC_LIB) rm -f $(lib_dir)/$(SHARED_LIB) rm -f $(lib_dir)/$(IMPORT_LIB) rm -f $(include_dir)/SDL/SDL_framerate.h rm -f $(include_dir)/SDL/SDL_gfxPrimitives.h rm -f $(include_dir)/SDL/SDL_imageFilter.h rm -f $(include_dir)/SDL/SDL_rotozoom.h clean: rm -f *.o *.a *.dll rm -f Test/*.o Test/*.exe

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!