ncurese全稱是new curses,是curses的升級版,比curses更好用。
ncursesw是ncurses的升級版,支持utf8字符集,也就是說它支持中文了。在ncurses中,中文會出現亂碼的情況。
採用默認參數編譯ncurses-6.5.tar.gz,最終得到的是libncursesw.so。
作者共發了5篇帖子。
![]() |
ncurese全稱是new curses,是curses的升級版,比curses更好用。 ncursesw是ncurses的升級版,支持utf8字符集,也就是說它支持中文了。在ncurses中,中文會出現亂碼的情況。 採用默認參數編譯ncurses-6.5.tar.gz,最終得到的是libncursesw.so。 |
![]() |
編譯得到的所有的庫文件都以w結尾。
![]() |
![]() |
The ncurses and ncursesw libraries are reasonably source-compatible. That is, an application written for 「ncurses」 will build with 「ncursesw」. But it will behave differently in response to your locale settings. (Some distributors, who do not care about the differences, have chosen to merge the names together as 「ncurses」). |
![]() |
ncurses-6.5默認編譯出來的是libncursesw.so。 configure的時候要加--disable-widec選項,才能編譯出不帶後綴w的libncurses.so。 |
![]() |
export PATH=$PATH:/home/oct1158/Downloads/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-linux-gnueabihf/bin
【在電腦上交叉編譯ncurses6.5】 [步驟1: 編譯帶後綴w的libncursesw.so庫] cd ~/Downloads wget https://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gz tar xf ncurses-6.5.tar.gz cd ncurses-6.5 ./configure --host=arm-none-linux-gnueabihf --with-shared make 修改progs/Makefile文件裡面第82行的INSTALL_PROG變量,在變量值的末尾添加 --strip-program=arm-none-linux-gnueabihf-strip 然後make install DESTDIR=$(pwd)/_installw [步驟2: 編譯不帶後綴w的libncurses.so庫] make distclean ./configure --host=arm-none-linux-gnueabihf --with-shared --disable-widec make 再修改一次progs/Makefile文件裡面第82行的INSTALL_PROG變量,在變量值的末尾添加 --strip-program=arm-none-linux-gnueabihf-strip 然後make install DESTDIR=$(pwd)/_install [步驟3:將libncurses庫的安裝文件與libncursesw混合, 同名文件用libncurses覆蓋(注意是用ncurses覆蓋ncursesw,不要搞反了)] mkdir _installw/usr/include/ncursesw mv _installw/usr/include/*.h _installw/usr/include/ncursesw mkdir _install/usr/include/ncurses cd _install/usr/include/ncurses for name in $(ls ../*.h) do ln -s $name . done cd ../../../.. cp -r _install/* _installw rm -rf _install cd _installw sudo chown -R root:root usr tar czf ncurses-6.5-binary.tar.gz usr mv ncurses-6.5-binary.tar.gz /var/www/html/oct1158 |