[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Trouble compiling transcode (Got it)




Finally got transcode to compile on this AMD64.  Many thanks to Petr Salinger form the Czech Republic!

Here are the instructions, and the only caveat I found is from SID to SARGE, the libavcodec-dev package is different.  So if you are on Sarge, here's what to do.  If you are running Sid, then you have to substitute the libavcodec-dev package for the Sarge distro version.  Otherwise the transcode make will crap out on vorbis function calls.  Perhaps the maintainers of the Sid version of libavcodec-dev can fix that problem...

--------------------------
apt-get install libavcodec-dev  libdvdread3-dev libmpeg2-4-dev
install lame via source
download and unpack transcode
in transcode configure - search and replace "-lavcodec" with "-lavcodec_pic" (5 times)
./configure
There is one more problem - after ./configure change in import/Makefile line
    LIBAVCODEC_LIBS = -L/usr/lib -lavcodec_pic -lm -lz -lpthread
into
    LIBAVCODEC_LIBS = -L/usr/lib -lavcodec_pic -ldts_pic -lm -lz -lpthread
After that make finished sucessfully.
--------------------------------------

I installed ffmpeg from source, but I believe that I didn't have to do that.  The libavcodec-dev package has ffmpeg header files in it.

Hope this helps someone else.

Thanks again Petr!

Bill



Petr Salinger wrote:
Hi.

  
gcc -shared .libs/import_ffmpeg.o -ldl -lz -lm -lpthread -lavcodec
-L/usr/lib -Wl,-soname -Wl,import_ffmpeg.so -o .libs/import_ffmpeg.so
/usr/bin/ld: /usr/lib/libavcodec.a(utils.o): relocation R_X86_64_32S 
against `a local symbol' can not be used when making a shared object; 
recompile with -fPIC
    

  
I tried adding fPIC to the line:
CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -g -O2
in Makefile, but no change.  
    
The key point is where to add -fPIC,
problem is in libavcodec.a, not the transcode.

Package libavcodec-dev contains two libraries, 
/usr/lib/libavcodec.a and  /usr/lib/libavcodec_pic.a	

For creating shared library, you have to link with libavcodec_pic.

gcc -shared .libs/import_ffmpeg.o -ldl -lz -lm -lpthread -lavcodec_pic 
-L/usr/lib -Wl,-soname -Wl,import_ffmpeg.so -o .libs/import_ffmpeg.so

Regards

	Petr



  

Reply to: