Pregunta

my LD_LIBRARY_PATH is currently at /usr/local/lib
anytime I try to call any library i get the following error

ld: library not found for -libfftw3
clang: error: linker command failed with exit code 1 (use -v to see invocation)

for example when I enter this:

$ gcc -o prog -L/usr/local/lib -libfftw3 -I/usr/local/include test.c

I've alredy tried the different extensions libfftw3.a, libfftw3.la, libfftw3.dyblib. Also reordered the command so that -I is before -L but nothing. Is there something that I'm missing? the -I/usr/local/include works fine and loads the headerfiles. It's just the library that I'm having an issue with.

¿Fue útil?

Solución

You don't specify the lib prefix of a library when linking, so use -lfftw3, look in /usr/local/lib/ for the actual library name, if it isn't libfftw3.a or libfftw3.so

-lfftw3 should be at the end of all the arguments.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top