链接

时间:2016-05-05 19:35:51

标签: c linker cygwin zlib

$ maek
gcc -lz -std=c11 -Wall -Werror -O3 cripper.o -o cripper
cripper.o:cripper.c:(.text+0x197): undefined reference to `inflateInit_'
cripper.o:cripper.c:(.text+0x197): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `inflateInit_'
cripper.o:cripper.c:(.text+0x213): undefined reference to `inflate'
cripper.o:cripper.c:(.text+0x213): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `inflate'
cripper.o:cripper.c:(.text+0x238): undefined reference to `inflateEnd'
cripper.o:cripper.c:(.text+0x238): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `inflateEnd'
cripper.o:cripper.c:(.text+0x2c2): undefined reference to `inflateEnd'
cripper.o:cripper.c:(.text+0x2c2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `inflateEnd'
collect2: error: ld returned 1 exit status
Makefile:7: recipe for target 'cripper' failed
make: *** [cripper] Error 1

非常确定我正在链接到zlib(我正在传递-lz标志),/lib/libz.a有违规函数,但链接器无法找到这些函数。

0 个答案:

没有答案