【发布时间】:2016-12-26 16:34:13
【问题描述】:
我正在尝试构建一个将静态版本的 libav 链接到其中的共享库。我使用--enable-pic 构建库以确保它对我有用。但是在与以下命令链接时:
g++ -shared -o libbrake.so -L./ -L./libs -Wl,-z,defs -Wl,--whole-archive -Wl,-Bsymbolic -lavcodec -lavfilter -lavformat -lavresample -lavutil -lswscale -lbluray -ldvdnav -ldvdread -lhandbrake -lvpx -ldl -lm -lpthread -lx264 -ltheoraenc -lvorbis -ljansson -la52 -lass -lbz2 -lz -lxml2 -lopus -lmp3lame -logg -lsamplerate -lfontconfig -ldca -lharfbuzz
libav 所需的静态库位于./libs 目录中,为.a 档案。
链接后出现错误:
./libs/libavformat.a(log2_tab.o):(.rodata+0x0): multiple definition of `ff_log2_tab'
有没有办法解决这个问题?
【问题讨论】:
-
查找第二个定义在哪里(
nm是你的朋友)。 -
我现在这样做了:使用
ar d我删除了多个对象文件。但我认为这很“脏”