compiling the fftw3 library through Makefiles

This is a discussion on compiling the fftw3 library through Makefiles within the C++ Programming forums, part of the General Programming Boards category; Hi everyone, I'm working on adding FFT's to my program. I'm using the fftw3 library, and everything compiles fine, but ...

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    1

    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:

    Code:
    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:

    Code:
    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

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    It would appear you want to read Linking - automake

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling A Shared library
    By Ectara in forum C Programming
    Replies: 6
    Last Post: 01-18-2010, 03:39 PM
  2. Compiling a library
    By MTK in forum C++ Programming
    Replies: 1
    Last Post: 12-03-2009, 04:04 PM
  3. Compiling Library Into Program.
    By Shogun in forum Linux Programming
    Replies: 10
    Last Post: 11-30-2004, 12:29 PM
  4. help with makefiles
    By metsman20 in forum C Programming
    Replies: 1
    Last Post: 04-20-2003, 09:50 PM
  5. Help with Makefiles
    By WebmasterMattD in forum Linux Programming
    Replies: 3
    Last Post: 05-24-2002, 08:51 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21