Results 1 to 3 of 3

Thread: Compiling Problems

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2014
    Posts
    2
    Platforms
    Unix/X11

    Default Compiling Problems

    Hey guys i am new here.
    Have the following problem with compiling my code
    I get after starting make sim_O following errors

    Classic_observables.o: In function `main':
    /home/sergej/Arbeitsfläche/Code/Classic_observables.cpp:75: undefined reference to `fftw_plan_dft_3d'
    /home/sergej/Arbeitsfläche/Code/Classic_observables.cpp:76: undefined reference to `fftw_plan_dft_3d'
    /home/sergej/Arbeitsfläche/Code/Classic_observables.cpp:384: undefined reference to `fftw_destroy_plan'
    /home/sergej/Arbeitsfläche/Code/Classic_observables.cpp:384: undefined reference to `fftw_destroy_plan'
    /home/sergej/Arbeitsfläche/Code/Classic_observables.cpp:385: undefined reference to `fftw_cleanup'
    Classic_observables.o: In function `fftw_norm(fftw_plan_s*, gsl_complex*, gsl_complex*, double)':
    /home/sergej/Arbeitsfläche/Code/ComplexGrid.h:32: undefined reference to `fftw_execute_dft'
    ItGPE.o: In function `fftw_not_norm(fftw_plan_s*, gsl_complex*, gsl_complex*, double)':
    /home/sergej/Arbeitsfläche/Code/ComplexGrid.h:48: undefined reference to `fftw_execute_dft'
    collect2: ld gab 1 als Ende-Status zurück
    make: *** [sim_O] Fehler 1

    However i already installes fftw3 and included it into the makefile (you can look at the code) :

    CC= g++
    EXTROOT= /home/sergej/Downloads/hdf5-1.8.12/hdf5
    EXTLIB= -L$(EXTROOT)/lib
    INCLUDE= -I$(EXTROOT)/include
    CFLAGS= -Wl,--no-as-needed -g -Wall -lgsl -lgslcblas -fopenmp -lfftw3 -lm -lfftw3_omp $(EXTLIB) -lhdf5
    LDFLAGS= -Wl,-rpath,/home/sergej/Downloads/hdf5-1.8.12/hdf5/lib
    OBJECTS_OBSER= Classic_observables.o kPropagator.o Initial.o ItGPE.o sGPE.o Noise.o BdG_QC.o Soliton.o GPE.o Observables.o
    OBJECTS_FIELD= Classic_fields.o kPropagator.o Initial.o ItGPE.o sGPE.o Noise.o BdG_QC.o Soliton.o GPE.o
    # Runge_Kutta.o

    #Calculate observables in C/C++, don't save fields
    sim_O : $(OBJECTS_OBSER)
    $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^

    #Calculate observables extern, just save fields
    sim_F : $(OBJECTS_FIELD)
    $(CC) $(CFLAGS) -o $@ $^

    %.o : %.cpp *.h
    $(CC) $(CFLAGS) $(INCLUDE) -c $<
    clean :
    -rm -f *.o *~

    cleanall:
    -rm -f *.o *~ sim_O sim_F

    cleandata:
    -rm -f ./data/*.*
    -rm -f ./data/tmp/*.*

    This shoul actually do the job
    Fftw ist installed by default in my /usr/local folder

    So does anybody have any suggestions ?
    (i am quite new to programming so sry if my mistakes are too obviuos or something else )

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Compiling Problems

    It would seem that /usr/local/lib (lib64, or /usr/local/fftw/lib as appropriate) is not in the linker's default library search path and you have not added it. Add it to EXTLIB with a -L option similar to the one that is already there.

    BTW: this is a Qt programming forum not a general C++ programming forum.

Similar Threads

  1. Problems compiling Qwt 6.1
    By prophetofreason in forum Qwt
    Replies: 6
    Last Post: 17th January 2013, 14:49
  2. Problems compiling when using an extern
    By aarelovich in forum Qt Programming
    Replies: 2
    Last Post: 24th June 2011, 12:32
  3. Cross Compiling Problems
    By memoody in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 5th November 2010, 09:33
  4. problems with compiling in qt4.6
    By nataly in forum Qt Programming
    Replies: 0
    Last Post: 14th December 2009, 12:09
  5. Problems compiling QT4.3 on Solaris 10
    By Ash_80 in forum Installation and Deployment
    Replies: 0
    Last Post: 26th May 2009, 15:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.