pkuvcl / davs2

An open-source decoder of AVS2-P2/IEEE1857.4 video coding standard
GNU General Public License v2.0
129 stars 52 forks source link

Final linking failed (GNU ld) #21

Closed tripulse closed 4 years ago

tripulse commented 4 years ago

Source files compile down to object files pretty well, but at the linking stage if fails to link which results in a incomplete build. The branch I chose for building is master.

Reproduction

the same instructions described in the README.md.

Expected behavior

In terminal when make is executed this should display:

make: Circular /home/tryamid/Projects/davs2/source/test/test.c <- /home/tryamid/Projects/davs2/source/test/test.c dependency dropped.
 [linking execution] davs2 
g++ -o davs2  test/test.o libdavs2.a  -m64  -lm -lpthread
/usr/bin/ld: libdavs2.a(blockcopy8.o): relocation R_X86_64_32S against hidden symbol `davs2_pb_1' can not be used when making a PIE object
/usr/bin/ld: libdavs2.a(dct8.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: libdavs2.a(mc-a2.o): relocation R_X86_64_32S against hidden symbol `davs2_pw_00ff' can not be used when making a PIE object
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:195: recipe for target 'davs2' failed
make: *** [davs2] Error 1

Pre-requisites

luofalei commented 4 years ago

Please try configure using the following command. It may help.

./configure --enable-pic
zhizhi-7699 commented 4 years ago

Please try configure using the following command. It may help.

./configure --enable-pic

请教如何在MIngW64或者msys2中成功编译呢~感谢,盼复

tripulse commented 4 years ago

@luofalei It worked without any issues, can you include that in the README.md?