我正在尝试构建一个将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'
有什么方法可以解决这个问题吗?
答案 0 :(得分:-2)
我已经这样完成了:使用ar d
删除多目标文件。但是我觉得这很“脏”
–尼德霍格