Hello all,
I'm currently playing with the possibility of writing a SDL (www.libsdl.org) PD external. I've ported my code to the PD external format and can compile, but upon loading PD refuses to load the external because it can't find the SDL library functions (Undefined Symbol).
So how can I access the SDL library functions from my external lib? How can I link my lib to the sdl lib?
cc: -lSDL: linker input file unused since linking not done cc: -lm: linker input file unused since linking not done cc: -lpthread: linker input file unused since linking not done
Here is my current Makefile: (based on the 6.externs example)
current: echo make pd_linux, pd_nt, pd_irix5, or pd_irix6
clean: ; rm -f *.pd_linux *.o
# ----------------------- LINUX i386 ----------------------- # Altered to compile SDL PD Externals
pd_linux: ben.pd_linux
.SUFFIXES: .pd_linux
CFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \ -Wall -W -Wshadow -Wstrict-prototypes -Werror \ -Wno-unused -Wno-parentheses -Wno-switch
INCLUDE = -I../../src
LIBS = -lSDL -lm -lpthread
.c.pd_linux: cc $(CFLAGS) $(LIBS) $(INCLUDE) -o $*.o -c $*.c ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm strip --strip-unneeded $*.pd_linux rm $*.o
I'm very new to C (been tinkering for only 2 weeks) so I'm still not quite clear on the whole linking/compiling process.
Any pointers would be appriciated.
If seeing my (ugly) sourcecode would help I'd be happy to send it along.
Thanks Ben
B. Bogart ---------
LIBS = -lSDL -lm -lpthread
.c.pd_linux: cc $(CFLAGS) $(LIBS) $(INCLUDE) -o $*.o -c $*.c ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm strip --strip-unneeded $*.pd_linux rm $*.o
fasthack : : : :: :
the LIBS sould be on the linking stage like this :
.c.pd_linux: cc $(CFLAGS) $(INCLUDE) -o $*.o -c $*.c ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm $(LIBS) strip --strip-unneeded $*.pd_linux rm $*.o
cheers,
sevy/yves
Woo hoo!!!
Thanks Yves!
I'll send out a screenshot in a minuite. :)
Ben
On Thu, 27 Jun 2002 ydegoyon@free.fr wrote:
LIBS = -lSDL -lm -lpthread
.c.pd_linux: cc $(CFLAGS) $(LIBS) $(INCLUDE) -o $*.o -c $*.c ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm strip --strip-unneeded $*.pd_linux rm $*.o
fasthack : : : :: :
the LIBS sould be on the linking stage like this :
.c.pd_linux: cc $(CFLAGS) $(INCLUDE) -o $*.o -c $*.c ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm $(LIBS) strip --strip-unneeded $*.pd_linux rm $*.o
cheers,
sevy/yves
PD-dev mailing list PD-dev@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev
B. Bogart ---------
I thought it would be a good learning experience (since I'm starting to learn C) to build a pd external which uses SDL to draw graphics.
This one does an alpha blend between two images, very very slowly.
But its a good start.
Thanks Ben
On Thu, 27 Jun 2002, Ben Bogart - FMPM/F1999 wrote:
Woo hoo!!!
Thanks Yves!
I'll send out a screenshot in a minuite. :)
Ben
On Thu, 27 Jun 2002 ydegoyon@free.fr wrote:
LIBS = -lSDL -lm -lpthread
.c.pd_linux: cc $(CFLAGS) $(LIBS) $(INCLUDE) -o $*.o -c $*.c ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm strip --strip-unneeded $*.pd_linux rm $*.o
fasthack : : : :: :
the LIBS sould be on the linking stage like this :
.c.pd_linux: cc $(CFLAGS) $(INCLUDE) -o $*.o -c $*.c ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm $(LIBS) strip --strip-unneeded $*.pd_linux rm $*.o
cheers,
sevy/yves
PD-dev mailing list PD-dev@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev
B. Bogart
PD-dev mailing list PD-dev@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev
B. Bogart ---------
i have configured Mailman to not accept mails that are larger than 40k. if you have webspace, please put large images there and just send a link to the list. people who have to pay will be thankful
mfg.cdsa.rt IOhannes