About to create a windows DLL for SDL_gfx

Hello;

I found a spanish page what expains how to create a Windows DLL with Visual
C++. Perfect, the method runs without problems, but I have a question:

SDL_gfx is a group of files (.h and .c files), and the method for create a
DLL is only for a empty files. Of course the files of de SDL_gfx aren’t
empty. Where I can find a manual about to create the DLL?. I was searching
in MSDN and in Google, but I can’t find this.

Thanks

you are using VC6 / VC7? There is a project file VC7 in the
SDL_gfx-2.0.13.zip file.

In vc6, start VC6, create an empty win32 DLL project. Add all gfx source
files.
alos in Project->settings->Link->project obtions, add SDL.lib at the end. It
should compile neatly.

Alternatively, read tutorials on how to use nmake files and how to complile
files in Command prompt.

Tony.> ----- Original Message -----

From: sdl-bounces+admin=windows-games.com@libsdl.org
[mailto:sdl-bounces+admin=windows-games.com at libsdl.org]On Behalf Of
ALTAIR -
Sent: Thursday, April 14, 2005 12:50 PM
To: sdl at libsdl.org
Subject: [SDL] About to create a windows DLL for SDL_gfx

Hello;

I found a spanish page what expains how to create a Windows DLL with Visual
C++. Perfect, the method runs without problems, but I have a question:

SDL_gfx is a group of files (.h and .c files), and the method for create a
DLL is only for a empty files. Of course the files of de SDL_gfx aren’t
empty. Where I can find a manual about to create the DLL?. I was searching
in MSDN and in Google, but I can’t find this.

Thanks


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Sorry about the time to the answer. My Internet conection was down.

you are using VC6 / VC7?
No, I use Dev-C++>From: “Windows-Games”
Reply-To: “A list for developers using the SDL library.
(includesSDL-announce)”
To: "A list for developers using the SDL library. (includes
SDL-announce)"
Subject: RE: [SDL] About to create a windows DLL for SDL_gfx
Date: Thu, 14 Apr 2005 14:03:24 +0530

you are using VC6 / VC7? There is a project file VC7 in the
SDL_gfx-2.0.13.zip file.

In vc6, start VC6, create an empty win32 DLL project. Add all gfx source
files.
alos in Project->settings->Link->project obtions, add SDL.lib at the end.
It
should compile neatly.

Alternatively, read tutorials on how to use nmake files and how to complile
files in Command prompt.

Tony.

-----Original Message-----
From: sdl-bounces+admin=windows-games.com at libsdl.org
[mailto:sdl-bounces+admin=windows-games.com at libsdl.org]On Behalf Of
ALTAIR -
Sent: Thursday, April 14, 2005 12:50 PM
To: sdl at libsdl.org
Subject: [SDL] About to create a windows DLL for SDL_gfx

Hello;

I found a spanish page what expains how to create a Windows DLL with Visual
C++. Perfect, the method runs without problems, but I have a question:

SDL_gfx is a group of files (.h and .c files), and the method for create a
DLL is only for a empty files. Of course the files of de SDL_gfx aren’t
empty. Where I can find a manual about to create the DLL?. I was searching
in MSDN and in Google, but I can’t find this.

Thanks

Cheers,

One needs to simply compile the library sources (.c/.h) with the defines
-DWIN32 and -DBUILD_DLL when creating the DLL. Use the define -DWIN32
when using the DLL.

There are VC6 and VC7 project files included in the SDL_gfx distribution

  • last time I checked they did not work though. Does anyone have updated
    files?

Also, here is a clip from the not-yet-released SDL_gfx version that
might help:

This makefile allows SDL_gfx to be compiled with mingw in cygwin.
Of note in this makefile:

  • You will have to change the path on line 5 to match where you want the
    library installed
  • You will have to change the CFLAGS to match your system.

----------Makefile---------
CC = gcc
AR=ar rc
RANLIB=ranlib

prefix=c:/dev/local
bin_dir=$(prefix)/bin
include_dir=$(prefix)/include
lib_dir=$(prefix)/lib

CFLAGS = -O3 -march=athlon-xp -mmmx -msse -m3dnow -DBUILD_DLL -DWIN32
-Ic:/dev/local/in
clude/SDL
LIBS = -Lc:/dev/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/TestGf
xPrimitives.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 -DWI
N32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestFramerate.o $(CFLAGS) -L…/
-Lc:/dev/local/lib -lmingw32 -lS
DLmain $(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 -lSDLma
in $(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 -D
WIN32 -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 -DWIN
32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestRotozoom.o $(CFLAGS) -L…/ -Lc:/dev/local/lib
-lmingw32 -lSD
Lmain $(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>

I found a spanish page what expains how to create a Windows DLL with
Visual C++. Perfect, the method runs without problems, but I have a
question:

SDL_gfx is a group of files (.h and .c files), and the method for
create a DLL is only for a empty files. Of course the files of de
SDL_gfx aren’t empty. Where I can find a manual about to create the
DLL?. I was searching in MSDN and in Google, but I can’t find this.