Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22265

Link libsndfile source code with gcc

$
0
0

I just cloned libsndfile and created program.c file with the following contents:

#include <stdio.h>#include <sndfile.h>main() {    printf("hello world");}

My goal is to get this file to compile using gcc (if indeed sndfile.h is the right header to include), however, I am not competent with c code nor the gcc compiler.

So far I've been referencing the gcc docs and the libsndfile FAQ and haven't been able to come up with a solution. I'm not sure if I even have a 'library' yet to feed the gcc -l option. Do I need to go through some sort of build process with the libsndfile source code first or can I 'link' to .c files?

So far, with program.c and the libsndfile clone directory in the same directory, I've tried the following:

gcc 'pkg-config --cflags libsndfile' program.c -o hellogcc 'pkg-config --cflags ./libsndfile/sndfile.pc.in' program.c -o hello

I'm coding on my raspberry pi model B and did not install libsndfile, so, nothing is on my path... maybe I should rename sndfile.pc.in to sndfile.pc and somehow put it on my path? (not a linux guru either!)

If there are some resources you think I should study please comment! I'm perfectly willing to accept answers that simply push me enough to figure things out. Any help would be much appreciated.


Viewing all articles
Browse latest Browse all 22265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>