S
siroregano
Hello-
I've got a nice C program written that uses libsndfile (#include
<sndfile.h>) to convert my raw data into a properly-formatted wav file.
The program is composed of a single .c file that compiles without error
under gnu/linux.
Unfortunately, when ld tries to link the file, I get the following:
bash> gcc -Wall -D_GNU_SOURCE wavconvert.c -o wavconvert
wavconvert.c: In function `main':
wavconvert.c:95: warning: implicit declaration of function `sfclose'
/tmp/ccfQdaR8.o(.text+0x149): In function `main':
: undefined reference to `sf_open'
/tmp/ccfQdaR8.o(.text+0x1d1): In function `main':
: undefined reference to `sf_write_int'
/tmp/ccfQdaR8.o(.text+0x1e9): In function `main':
: undefined reference to `sf_strerror'
/tmp/ccfQdaR8.o(.text+0x20c): In function `main':
: undefined reference to `sfclose'
collect2: ld returned 1 exit status
I've googled the error, but people only seem to experience it:
- When using g++, or
- When using gcc under a gygwin environment
I've tried including the file using:
#include "/usr/include/sndfile.h"
....instead of the standard inclusion, but this doesn't change ld's
behavior. I've verified that the file is indeed there, and does refer
to a .so library that is present where expected.
Does anyone know what I might do to mitigate this?
Thanks,
Dave
I've got a nice C program written that uses libsndfile (#include
<sndfile.h>) to convert my raw data into a properly-formatted wav file.
The program is composed of a single .c file that compiles without error
under gnu/linux.
Unfortunately, when ld tries to link the file, I get the following:
bash> gcc -Wall -D_GNU_SOURCE wavconvert.c -o wavconvert
wavconvert.c: In function `main':
wavconvert.c:95: warning: implicit declaration of function `sfclose'
/tmp/ccfQdaR8.o(.text+0x149): In function `main':
: undefined reference to `sf_open'
/tmp/ccfQdaR8.o(.text+0x1d1): In function `main':
: undefined reference to `sf_write_int'
/tmp/ccfQdaR8.o(.text+0x1e9): In function `main':
: undefined reference to `sf_strerror'
/tmp/ccfQdaR8.o(.text+0x20c): In function `main':
: undefined reference to `sfclose'
collect2: ld returned 1 exit status
I've googled the error, but people only seem to experience it:
- When using g++, or
- When using gcc under a gygwin environment
I've tried including the file using:
#include "/usr/include/sndfile.h"
....instead of the standard inclusion, but this doesn't change ld's
behavior. I've verified that the file is indeed there, and does refer
to a .so library that is present where expected.
Does anyone know what I might do to mitigate this?
Thanks,
Dave