compiling the fftw3 library through Makefiles

Hi everyone,

I'm working on adding FFT's to my program. I'm using the fftw3 library, and everything compiles fine, but every time I run the program it crashes, giving me the error:

undefined symbol: fftw_plan_dft_1d

I was able to circumvent this using the -lm and -lfftw3 commands while compiling directly, but now that I am using makefiles to create my programs I don't know how to link the libraries to the program. My Makefile is very, very long and complicated (600 lines; it's an edited RTXI file), but my Makefile.am looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CLEANFILES = moc_*.cpp *~
DISTCLEANFILES =
MAINTAINERCLEANFILES = Makefile.in

include $(top_srcdir)/Makefile.buildvars

pkglib_LTLIBRARIES = data_recorder.la

LIBS = $(HDF_LIBS) 

data_recorder_la_LDFLAGS = -module -avoid-version

data_recorder_la_SOURCES = \
		data_recorder.h \
		data_recorder.cpp
nodist_data_recorder_la_SOURCES = \
		moc_data_recorder.cpp

# MOC Rule - builds meta-object files as needed
moc_%.cpp: %.h
	$(MOC) -o $@ $<


I tried adding -lm -lfftw3 to the LIBS line, and also tried adding the actual library file (/disk/media/fftw-3.2.2/libfftw3.la) to the LIBS line, but I only ever got an -fPIC error (could not read symbols: Bad value).

Any help I could get on this would be greatly appreciated!

Thanks! Mike
Topic archived. No new replies allowed.