Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6641213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:47:04+00:00 2026-05-25T23:47:04+00:00

Having an issue with getting a makefile to find the correct libraries and header

  • 0

Having an issue with getting a makefile to find the correct libraries and header files for a .c program I’m trying to compile. I’m trying to compile an open source segmenter for Apple’s HTTP Live Streaming and it requires libavformat and other FFMpeg libraries to compile. I used Mac Ports to install FFMpeg and when I run “which ffmpeg” at command line, the directory it shows is opt/local/bin/ffmpeg, but after searching around, this doesn’t seem to be the directory with the libraries.

It seems that the libraries are located in opt/local/include because that is where I see the header files. Here is my makefile with the suspected 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 output 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

I also tried running “ffmpeg -version” to see if ffmpeg was built correctly and it seems to be so I have run out of ideas on what to do. Any help or point in the right direction would be great. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:47:04+00:00Added an answer on May 25, 2026 at 11:47 pm

    I think you have too many -I and not enough -L. From gcc(1) on Lion:

    -I dir 
       Add the directory dir to the list of directories to be searched for 
       header files.  Directories named by -I are searched before the standard
       system include directories.  If the directory dir is a standard system 
       include directory, the option is ignored to ensure that the default
       search order for system directories and the special treatment of system
       headers are not defeated.
    
     -L dir
       Add directory dir to the list of directories to be searched for -l.
    

    -l<libname> is a linker directive that tells ld to include lib<libname> from wherever in the -L directory list.

    Try this, instead:

    gcc -Wall -g live_segmenter.c -o live_segmenter -I/opt/local/include -L/opt/local/lib -lavcodec -lavutil -lavcore -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue getting files loaded into an app called GCS, by dragging
I'm having an issue getting the correct value from my drop down box. Basically
I am having an issue getting blast_seconds to show up as the correct value.
I'm having an issue getting a LINQ query to work. I have this XML:
I'm having an issue getting some code to work. Is there a way to
I'm having an issue getting this CSS for a sprite sheet to work on
I'm having an issue getting Appstats to work correctly. Using /appstats or /appstats/stats ends
I'm having an issue with getting the fancybox iframe to load in the browser.
I am getting into C# and I am having this issue: namespace MyDataLayer {
I am having an issue with sockets where the data I'm sending is getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.