[PD] Help with writing externals

Frank Barknecht fbar at footils.org
Fri Apr 2 22:35:13 CEST 2004


Hallo,
thewade hat gesagt: // thewade wrote:

> I have a question reguarding writing externals.  Ive never really
> built anything Ive written myself in linux sence my CSCI classes in
> college, can someone remind me as to how to build in the linux
> environment?
> 
> Heres my makefile
> -----------------------------------------------------
> LDFLAGS = -Wl,-export-dynamic -lasound -lrt -ljack

Do you really need link in librt, libjack and libasound?

> LIB =   -ldl -lm -lpthread -lasound
> 
> INCLUDE = -I/usr/local/include
> BIN_DIR = ../general
> 
> EXT= pd_linux
> 
> sphere: $(CC) $(LDFLAGS) $(INCLUDE) -o $(BIN_DIR)/sphere~.$(EXT) sphere~.c
> 
> fft-bin: $(CC) $(LDFLAGS) $(INCLUDE) -o $(BIN_DIR)/fft-bin~.$(EXT) fft-bin~.
> -----------------------------------------------------
> but the compiler isint finding my m_pd.h I think, as I get:
> 
> gcc -Wl,-export-dynamic -lasound -lrt -ljack -I/usr/local/include -o ../general/fft-bin~.pd_linux fft-bin~.c
> /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o(.text+0x18): In function `_start\':
> : undefined reference to `main\'
> /tmp/ccAyKAvm.o(.text+0xf): In function `fftbin_tilde_new\':
> : undefined reference to `gensym\'

I'm no compiler wizard, but I think, your makefile misses the "-c"
option in the gcc call. "-c" tells gcc, that you are not building a
really application (with "int main() ...") but just a module. 

I normally just do copy-paste makefiles. The CVS has some good
examples. Probably the easies to reuse could be the one in 
externals/build/linux/makefile which is used to compile most of the
CVS externals. Just drop it into your source dir and try "make".

ciao
-- 
 Frank Barknecht                               _ ______footils.org__




More information about the Pd-list mailing list