axel
axel copied to clipboard
undefined reference to 'libintl_XXX'
I meet a problem about undefined reference to 'libintl_XXX' in [email protected],as shown below:
root@ubuntu:src# make
CCLD axel
text.o: In function `print_help':
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:673: undefined reference to `libintl_gettext'
text.o: In function `print_alternate_output':
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:587: undefined reference to `libintl_gettext'
text.o: In function `main':
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:107: undefined reference to `libintl_bindtextdomain'
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:108: undefined reference to `libintl_textdomain'
text.o: In function `print_version':
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:701: undefined reference to `libintl_gettext'
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:702: undefined reference to `libintl_gettext'
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:702: undefined reference to `libintl_gettext'
text.o: In function `main':
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:204: undefined reference to `libintl_gettext'
/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:261: undefined reference to `libintl_gettext'
text.o:/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/src/text.c:247: more undefined references to `libintl_gettext' follow
collect2: error: ld returned 1 exit status
Makefile:393: recipe for target 'axel' failed
make: *** [axel] Error 1
I know that the ubuntu compiler is faulty. The libintl link library is located in an incorrect position, causing the libintl link library to fail. Therefore, I add -lintl to the end of the link library by using the LIBS parameter. Here's my solution:
root@ubuntu:src# vim Makefile
……
199 GREP = /bin/grep
200 INSTALL = /usr/bin/install -c
201 INSTALL_DATA = ${INSTALL} -m 644
202 INSTALL_PROGRAM = ${INSTALL}
203 INSTALL_SCRIPT = ${INSTALL}
204 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
205 INTLLIBS = -lintl
206 INTL_MACOSX_LIBS =
207 LDFLAGS = -lintl -pthread
208 LIBICONV = -liconv
209 LIBINTL = -lintl
210 LIBOBJS =
- 211 LIBS =
+ 211 LIBS = -lintl
212 LTLIBICONV = -liconv
213 LTLIBINTL = -lintl
214 LTLIBOBJS =
215 MAKEINFO = ${SHELL} '/home/all_spack_env/spack_stage/root/spack-stage-axel-2.16.1-tyfvmk27ozb62ab5ouhwmdrwjaoqyglw/spack-src/missing' makeinfo
216 MKDIR_P = /bin/mkdir -p
217 MSGFMT = /home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/gettext-0.21-pahcwqqpkyw7nnatkmlxoiajupqj63jb/bin/msgfmt
218 MSGFMT_015 = /home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/gettext-0.21-pahcwqqpkyw7nnatkmlxoiajupqj63jb/bin/msgfmt
219 MSGMERGE = /home/all_spack_env/spack/opt/spack/linux-ubuntu18.04-aarch64/gcc-7.5.0/gettext-0.21-pahcwqqpkyw7nnatkmlxoiajupqj63jb/bin/msgmerge
220 OBJEXT = o
……
392 axel$(EXEEXT): $(axel_OBJECTS) $(axel_DEPENDENCIES) $(EXTRA_axel_DEPENDENCIES)
393 @rm -f axel$(EXEEXT)
394 $(AM_V_CCLD)$(LINK) $(axel_OBJECTS) $(axel_LDADD) $(LIBS)
395
……
root@ubuntu:src# make
CC axel.o
CC conf.o
CC conn.o
CC ftp.o
CC http.o
CC search.o
CC ssl.o
CC tcp.o
CC text.o
CCLD axel
The problem has been resolved, but I'm not sure if this version is still being maintained or will have other unpredictable consequences. Can you help me check it out?
Is there any other solution?
Is [email protected] an old version that is rarely used by users? Is it maintained by others? If not, which version do you recommend to solve this problem?
Try version 2.17.10.