Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-15-2013, 01:11 AM   #1
LQ Newbie
Registered: Nov 2013
Posts: 3

Rep: Reputation: Disabled
trouble linking ffmpeg example code on linux

I'm trying to work on the ffmpeg example source file. Now, I'm trying to compile and link from the command line but I can't seem to get it to link.

I compiled the code and generated obj file.

My problem is on linking ,

I just tried this:

gcc -Wall -o example -L/home/jayanthi/example -lavcodec -lavutil example.o

At this point, I get error of 'undefined reference error'

example.o: In function `audio_encode_example':
example.c.text+0x25): undefined reference to `avcodec_find_encoder'
example.c.text+0x6a): undefined reference to `avcodec_alloc_context3'
example.c.text+0xad): undefined reference to `avcodec_open'
example.c.text+0x1ce): undefined reference to `sin'
example.c.text+0x238): undefined reference to `
..... etc.
collect2: ld returned 1 exit status
please help me out
Old 11-15-2013, 05:19 PM   #2
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2
Posts: 316

Rep: Reputation: 76
Libraries after object files.

gcc -o output_exe example.o -L/home/example -lavcodec


ffmpeg, linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation of ffmpeg c code on linux JAYANTHI Linux - Newbie 1 11-13-2013 01:52 PM
Linking Masm .obj in linux C code yousafsajjad Programming 1 07-07-2010 02:38 PM
Linking C code against C++ library knobby67 Programming 1 12-06-2007 11:09 AM
Make Trouble linking some fortran code Make file problem? any ideas? TheBrick Linux - General 0 05-17-2006 11:21 AM
Trouble linking with libmqueue on Linux 2.6.5 -mm illuminatedwax Programming 0 04-14-2004 07:55 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:33 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration