Error when compiling for ARM
I tried to build in aarch64 inside Termux (Android) and everything went smooth until the linking process, i got a "libiconv" error message (but libiconv is installed). Make output:
$ cmake --build build_dir -j 3
[ 3%] Built target termkey
[ 30%] Built target lua
[ 57%] Built target scintilla
[ 63%] Built target lpeg
[ 81%] Built target cdk
[ 82%] Built target lfs
[ 84%] Built target regex
[ 87%] Built target scintilla_curses
[ 97%] Built target lexilla
[ 98%] Built target textadept_curses
[ 99%] Linking CXX executable textadept-curses
ld.lld: error: undefined symbol: libiconv_open
>>> referenced by textadept.c:670 (/data/data/com.termux/files/home/textadept/src/textadept.c:670)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
ld.lld: error: undefined symbol: libiconv
>>> referenced by textadept.c:677 (/data/data/com.termux/files/home/textadept/src/textadept.c:677)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
>>> referenced by textadept.c:677 (/data/data/com.termux/files/home/textadept/src/textadept.c:677)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
ld.lld: error: undefined symbol: libiconv_close
>>> referenced by textadept.c:686 (/data/data/com.termux/files/home/textadept/src/textadept.c:686)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
>>> referenced by textadept.c:684 (/data/data/com.termux/files/home/textadept/src/textadept.c:684)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/textadept-curses.dir/build.make:109: textadept-curses] Error 1
make[1]: *** [CMakeFiles/Makefile2:375: CMakeFiles/textadept-curses.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I apologize inadvance if it is a noob question, but I really don't understand what I'm doing wrong: it compiled without any problem on Debian_x86_64, and I can't find any further info about this error anywhere online.
configure with
LDFLAGS=-liconv cmake ...
Thank you for your help. I tried but nothing has changed, am I missing something? I am only interested in the curses/terminal version, and I have set to "false" all the QT, GTK2, and GTK3 flags.
Build output:
$ LDFLAGS=-liconv cmake --build build_dir -j 3
[ 3%] Built target termkey
[ 30%] Built target lua
[ 57%] Built target scintilla
[ 75%] Built target cdk
[ 81%] Built target lpeg
[ 82%] Built target lfs
[ 84%] Built target regex
[ 87%] Built target scintilla_curses
[ 97%] Built target lexilla
[ 98%] Built target textadept_curses
[ 99%] Linking CXX executable textadept-curses
ld.lld: error: undefined symbol: libiconv_open
>>> referenced by textadept.c:670 (/data/data/com.termux/files/home/textadept/src/textadept.c:670)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
ld.lld: error: undefined symbol: libiconv
>>> referenced by textadept.c:677 (/data/data/com.termux/files/home/textadept/src/textadept.c:677)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
>>> referenced by textadept.c:677 (/data/data/com.termux/files/home/textadept/src/textadept.c:677)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
ld.lld: error: undefined symbol: libiconv_close
>>> referenced by textadept.c:686 (/data/data/com.termux/files/home/textadept/src/textadept.c:686)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
>>> referenced by textadept.c:684 (/data/data/com.termux/files/home/textadept/src/textadept.c:684)
>>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua)
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/textadept-curses.dir/build.make:109: textadept-curses] Error 1
make[1]: *** [CMakeFiles/Makefile2:375: CMakeFiles/textadept-curses.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Thank you for your help. I tried but nothing has changed, am I missing something? I am only interested in the curses/terminal version, and I have set to "false" all the QT, GTK2, and GTK3 flags.
Build output:
$ LDFLAGS=-liconv cmake --build build_dir -j 3 [ 3%] Built target termkey [ 30%] Built target lua [ 57%] Built target scintilla [ 75%] Built target cdk [ 81%] Built target lpeg [ 82%] Built target lfs [ 84%] Built target regex [ 87%] Built target scintilla_curses [ 97%] Built target lexilla [ 98%] Built target textadept_curses [ 99%] Linking CXX executable textadept-curses ld.lld: error: undefined symbol: libiconv_open >>> referenced by textadept.c:670 (/data/data/com.termux/files/home/textadept/src/textadept.c:670) >>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua) ld.lld: error: undefined symbol: libiconv >>> referenced by textadept.c:677 (/data/data/com.termux/files/home/textadept/src/textadept.c:677) >>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua) >>> referenced by textadept.c:677 (/data/data/com.termux/files/home/textadept/src/textadept.c:677) >>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua) ld.lld: error: undefined symbol: libiconv_close >>> referenced by textadept.c:686 (/data/data/com.termux/files/home/textadept/src/textadept.c:686) >>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua) >>> referenced by textadept.c:684 (/data/data/com.termux/files/home/textadept/src/textadept.c:684) >>> CMakeFiles/textadept-curses.dir/src/textadept.c.o:(iconv_lua) clang-16: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [CMakeFiles/textadept-curses.dir/build.make:109: textadept-curses] Error 1 make[1]: *** [CMakeFiles/Makefile2:375: CMakeFiles/textadept-curses.dir/all] Error 2 make: *** [Makefile:136: all] Error 2
you need to configure with LDFLAGS
LDFLAGS=-liconv cmake -S . -B build_dir -D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_INSTALL_PREFIX=build_dir/install
cmake --build build_dir -j # compiled binaries are in build_dir/
cmake --install build_dir # self-contained installation is in build_dir/install/
You are a saviour! It worked! THANK YOU!!!
I hope this will help other people that will get the same error when trying to use this awesome editor on their ARM devices