You are having trouble getting the makefile to find the correct libraries and header files for the .c program I'm trying to compile. I am trying to compile an open source sequencer for Apple HTTP Live Streaming, and it requires libavformat and other FFMpeg libraries to compile it. I used Mac Ports to install FFMpeg, and when I run "what ffmpeg" on the command line, the directory that it shows is opt / local / bin / ffmpeg, but after searching, it doesn't look like the library directory.
The libraries seem to be located in opt / local / include, because that's where I see the header files. Here is my makefile with a suspicious directory:
all: gcc -Wall -g live_segmenter.c -o live_segmenter -I / opt / local / include -I / opt / local / bin -I / opt / local / include / libavutil -L / opt / local / include / libavformat - libavformat - L / opt / local / include -libavcodec -L / opt / local / include -libavutil -L / opt / local / include -libavcore -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread
clean:
rm -f live_segmenter
And here is the result after trying to compile:
gcc -Wall -g live_segmenter.c -o live_segmenter -I / opt / local / include -I / opt / local / bin - I / opt / local / include / libavutil -L / opt / local / include / libavformat -libavformat - L / opt / local / include -libavcodec -L / opt / local / include -libavutil -L / opt / local / include - libavcore -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread
ld: library not found for -libavformat
collect2: ld returned 1 exit status
make: *** [all] Error 1
"ffmpeg -version", , ffmpeg , , , . . !