Undefine symbols for architecture x86_64 using FFTW
Asked Answered
H

1

2
Ceeloss-MacBook-Pro:desktop ceelos$ gcc -o prog -I/usr/local/include test.c
Undefined symbols for architecture x86_64:
  "_fftw_destroy_plan", referenced from:
      _main in test-IBqBdS.o
  "_fftw_execute", referenced from:
      _main in test-IBqBdS.o
  "_fftw_plan_dft_1d", referenced from:
      _main in test-IBqBdS.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Ceeloss-MacBook-Pro:desktop ceelos$ 


What's this telling me?

Honan answered 30/11, 2013 at 11:59 Comment(0)
D
4

It's telling you that you forgot to use -L and -l to tell gcc where the FFTW libraries are and what they're called.

Dias answered 30/11, 2013 at 12:6 Comment(13)
sorry, I'm really new to this. How exactly would I specify this? My library is under /usr/local/libHonan
-L takes the library location, and -l takes the library filename minus the "lib" and the extension. -L/usr/local/lib -lfftwwhateverDias
hmm, I keep getting "ld: library not found for -libfftw3.la clang: error: linker command failed with exit code 1 (use -v to see invocation)" strange, i'm staring at the file there right now.Honan
Please read my comment again. I believe that you have missed a couple of things.Dias
Sorry for having a hard time with this. I entered "gcc -o prog -I/usr/local/include test.c -L/usr/local/lib -lfftw3f.la" and it gave me this error.Honan
Try -lfftw3f instead. But you may need to reorder the options.Dias
Yeah, I tried that and reordering, still doesn't find the library. Weird.Honan
What is the .dylib file called?Dias
I don't have one. the make install didn't create one nor did it come with the zip file. Unless I was supposed to create one myself.Honan
yes, two, a regular one and one for floats. libfftw3.a and libfftw3f.aHonan
That's really strange. If you're passing both arguments and it still can't find the library then I don't know what's going on.Dias
It's fine, I'll see what I figure. Thanks for all your help. I appreciate it.Honan
Hey, I was able to add the .dylibs.Honan

© 2022 - 2024 — McMap. All rights reserved.