vlc arm交叉编译
以vlc-2.2.4为例,下载:
http://download.videolan.org/pub/videolan/vlc/2.2.4/
交叉编译器: arm-linux-gnueabihf-
cd /home/hjc/video/vlc-2.2.4
vim build_arm.sh
内容:
#!/bin/bash export NM=arm-linux-gnueabihf-nm export LD=arm-linux-gnueabihf-ld export CPLUS=arm-linux-gnueabihf-g++ export RANLIB=arm-linux-gnueabihf-ranlib export strip=arm-linux-gnueabihf-strip export AR=arm-linux-gnueabihf-ar export CC=arm-linux-gnueabihf-gcc export CXX=arm-linux-gnueabihf-g++ export ARCH=arm export CFLAGS=' -O2' export CXXFLAGS=' -O2' export LIBS="$LIBS -lpthread" export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/home/hpd/arm/lib/pkgconfig" ./configure --target=arm-linux-gnueabihf --host=arm-linux-gnueabihf --prefix=/home/hpd/arm/vlc / --disable-live555 --enable-run-as-root --en able-debug --disable-avcodec --disable-avformat / --disable-swscale --disable-postproc --disable-a52 --disable-sdl --disable-fribidi --disable-libgcrypt / --disable-gnutls --disable-skins2 --disable-qt4 --disable-notify --disable-libxml2 --disable-freetype / --disable-bonjour --dis able-lua --disable-mad --disable-dbus --disable-jack --host=arm-linux / --disable-mtp --disable-dvdnav --disable-dvdread --disable-linsys / --disable-alsa --disable-xcb --disable-dvbpsi --disable-directfb --disable-directx
赋予可执行权限:
chmod a+x build_arm.sh
./build_arm.sh
make
执行的时候,报错:
warning: libvlccore.so.8, needed by …/lib/.libs/libvlc.so, not found (try using -rpath or -rpath-link)
这种错误,经分析查找是bin模块编译时找不到 libvlccore.so.8这个库。简单的解决办法是修改 bin下的Makefile,指定库文件位置,用find查找一下,发现生成在 src/.libs 目录下:
vim ./bin/Makefile
修改 LDFLAGS 指定实际 libvlccore.so.8 所在的位置:
LDFLAGS = -L…/src/.libs -lvlccore
然后,重新 make
make install