|
Hello. I am very new to linux, so my question is probably easy.
I am trying to compile a program against a statically linked fftw library. Here is what I have: /usr/local/include/fftw.h /usr/local/lib/libfftw.a /usr/local/lib/libfftw.la
fftw_print_plan in putils.c 00000b30 T fftw_print_plan
So this means that function fftw_print_plan is exported by the library, right?
Now, here is what I am trying to compile: string.c: #include <stdio.h> #include <fftw.h>
void main(int argc, char *argv[]) { fftw_print_plan(p);
/tmp/ccGZNEb9.o(.text+0x1a): In function 'main': : undefined reference to 'fftw_print_plan' collect2: ld returned 1 exit status
I also tried it this way:
<string.o was successfully cello. I am very new to linux, so my question is probably easy.
I am trying to compile a program against a statically linked fftw library. Here is what I have: /usr/local/include/fftw.h /usr/local/lib/libfftw.a /usr/local/lib/libfftw.la
fftw_print_plan in putils.c 00000b30 T fftw_print_plan
So this means that function fftw_print_plan is exported by the library, right?
Now, here is what I am trying to compile: string.c: #include <stdio.h> #include <fftw.h>
void main(int argc, char *argv[]) { fftw_print_plan(p);
/tmp/ccGZNEb9.o(.text+0x1a): In function 'main': : undefined reference to 'fftw_print_plan' collect2: ld returned 1 exit status
I also tried it this way:
<string.o was successfully created>
ld: warning: cannot find entry symbol _start; defaulting to 0000000008048074 string.o(.text+0x1a): In function 'main': : undefined reference to 'fftw_print_plan'
I noticed that function 'fftw_print_plan' is defined in fftw.h as: extern void fftw_print_plan(fftw_plan plan);
I am not sure why it is defined as extern...
I also checked that the signature of the function matches in the code (putils.c)
I have no idea why this is not working. Any help whould be greatly appreciated...
|