What's new

Undefined ref while compiling

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

ult

New Around Here
Im trying to compile asuswrt-merlin firmware for a rt-ac68u, however I am getting an error and I cant quite figure out how to handle it.


/root/asuswrt-merlin/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../lib/gcc/arm-brcm-linux-uclibcgnueabi/4.5.3/../../../../arm-brcm-linux-uclibcgnueabi/bin/ld: warning: libiconv.so.2, needed by //root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so, not found (try using -rpath or -rpath-link)
//root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so: undefined reference to `libiconv'
//root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so: undefined reference to `libiconv_close'
//root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status

Its pretty clear that libiconv.so.2 needs to be linked somewhere, but where do I link it? Im not sure where its looking.

Thanks in advanced ^_^
 
Im trying to compile asuswrt-merlin firmware for a rt-ac68u, however I am getting an error and I cant quite figure out how to handle it.


/root/asuswrt-merlin/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../lib/gcc/arm-brcm-linux-uclibcgnueabi/4.5.3/../../../../arm-brcm-linux-uclibcgnueabi/bin/ld: warning: libiconv.so.2, needed by //root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so, not found (try using -rpath or -rpath-link)
//root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so: undefined reference to `libiconv'
//root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so: undefined reference to `libiconv_close'
//root/asuswrt-merlin/release/src-rt-6.x.4708/router/samba36/source3/bin/libsmbclient.so: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status

Its pretty clear that libiconv.so.2 needs to be linked somewhere, but where do I link it? Im not sure where its looking.

Thanks in advanced ^_^

You should be checking out from a stable tag, as HEAD might not always compile cleanly for everyone. The libiconv change only happened recently, and it might still have issues on some development systems.
 
Didn't check your recent commits, just looked and you just added it the day before. xD

Its been fixed with your recent commit and will build from tag and not HEAD. Thanks for replying =]

Best regards
 
I see this when building asuswrt-merlin.ng code on fedora 27 and 30. No problem seen on ubuntu 14.04. A fix is to explicitly include libiconv in the LDFLAGS for wget:
Code:
diff --git a/release/src/router/Makefile b/release/src/router/Makefile
index 3613040984..a01e559fdd 100644
--- a/release/src/router/Makefile
+++ b/release/src/router/Makefile
@@ -6232,7 +6232,7 @@ wget/Makefile: wget/Makefile.in
                $(if $(RTCONFIG_IPV6),,--disable-ipv6) --disable-iri --without-included-regex  \
                --disable-dependency-tracking \
                CFLAGS="-Os -Wall $(EXTRACFLAGS) -ffunction-sections -fdata-sections -I$(TOP)/openssl/include -I$(TOP)/zlib" \
-               LDFLAGS="$(EXTRALDFLAGS) -Wl,--gc-sections -L$(TOP)/openssl -lssl -lcrypto -L$(TOP)/zlib -lz"
+               LDFLAGS="$(EXTRALDFLAGS) -Wl,--gc-sections -L$(TOP)/openssl -lssl -lcrypto -L$(TOP)/zlib -lz -L$(TOP)/libiconv-1.14/lib/.libs -liconv"

Note: A similar explicit setting is done for "bluez" elsewhere in the Makefile.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top