- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试使用 cygwin 在 Windows 上编译 enc2ly ( http://enc2ly.sourceforge.net/en/ ),但它会出错。当我键入 ./configure
时,结果如下:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by GCC... /usr/i686-pc-cygwin/bin/ld.exe
checking if the linker (/usr/i686-pc-cygwin/bin/ld.exe) is GNU ld... yes
checking for shared library run path origin... done
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... no
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for GNU gettext in libintl... yes
checking whether to use NLS... yes
checking where the gettext function comes from... external libintl
checking how to link with libintl... -lintl
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for error_at_line... yes
checking for memset... yes
checking for strstr... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating dok/Makefile
config.status: creating iloj/Makefile
config.status: creating kod/Makefile
config.status: creating enc2ly.spec
config.status: creating enc2ly.lsm
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
当我键入 make
时,它失败了。我怀疑问题出在这里:
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... no
那么,缺少哪些包?或者是另一回事?无论如何谢谢。
--------------------编辑------------------------ -
我使用了 ./configure --disable-nls
并且它有效。所以问题真的是gettext。
checking for GNU gettext in libc... no
我已经安装了 gettext 包。少了什么?我必须解决这个问题,因为程序的主要语言是世界语!
最佳答案
我花了一些时间(可能太多了)来研究这个,并且我已经成功地构建了它。
在 Ubuntu 12.04 上,它构建出
box
.tar.gz
文件没有问题,找到并使用 GNU gettext。在 Cygwin 上,我遇到了与您相同的错误。
一个区别是在Cygwin上,使用gettext
的程序需要用-lintl
链接;在 Ubuntu 上,它没有(显然 gettext
在标准 C 库中)。
在对 configure
脚本进行了一番折腾之后,我想到了以下解决方法:
首先,在调用./configure
之前,将环境变量$LIBS
设置为"-lintl"
。
其次,似乎是 Ubuntu 库而非 Cygwin 库提供了一个未记录的符号 _nl_domain_bindings
,configure
生成的小测试程序依赖于该符号.所以我破解了 configure
脚本,在生成的 C 测试程序中注释掉对 _nl_domain_bindings
的引用。
黑客配置
不是解决这个问题的正确方法; configure
脚本由其他工具生成(在源代码发布之前)。您需要熟悉 GNU autoconf 的人提出更好的解决方案。并且 configure
应该 能够自行检测是否需要 -lintl
选项。
这里确实有些奇怪:-lintl
在源代码树中唯一出现的是 enc2ly-0.2/m4/gettext.m4
中的以下行:
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
它通过删除任何出现的-lintl
来修改$LIBS
。如果有一些评论可以解释这一点,那可能是世界语。 (从没想过我会这么说,除非是开玩笑。)
所以我注释掉了那一行,它起作用了,生成了一个 enc2ly.exe
文件,如果我不带参数调用它,它至少会打印一条用法消息:
$ /usr/local/apps/enc2ly-0.2/bin/enc2ly.exe
Dosieroj sukcese procezitaj: 0 (domaĝe!)
$
是的,那是世界语;谷歌翻译将它翻译成
Files successfully procezitaj: 0 (domaĝe!)
我将我的
修改
丑陋的 hack 保存在本地 Git 存储库中。这是 git diff
的输出:
diff --git a/configure b/configure
index 1605a50..8d1a1b7 100755
--- a/configure
+++ b/configure
@@ -5162,12 +5162,12 @@ else
#include <libintl.h>
$gt_revision_test_code
extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;
+/* extern int *_nl_domain_bindings; */
int
main ()
{
bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr /* + *_nl_domain_bindings */
;
return 0;
}
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index f84e6a5..6c77c3a 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -247,7 +247,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
USE_INCLUDED_LIBINTL=yes
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
- LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+# LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
CATOBJEXT=
获取 enc2ly-0.2.tar.gz
,解压它,应用上述更改(很容易手动完成),将环境变量 $LIBS
设置为 -lintl
,正常构建和安装,你应该可以开始了。
您可能想就此问题联系维护人员;我敢肯定他们想要实现比这更清洁的解决方案。
关于windows - 在 Windows : why cygwin can't recognize gettext? 上编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11803744/
假设我有一个在 cygwin 下编译的应用程序,并且我想在不让用户安装 cygwin 的情况下分发该应用程序。打包可执行文件和 cygwin DLL 就足够了吗? 最佳答案 事情发生了变化。 Cygw
我从一个镜像站点下载了 cygwin,几个月后,当我尝试更新时,我收到一条消息:“当前 ini 文件来自较新版本的 setup-x86_64.exe” 如果我下载了新的 ini 文件,是否也意味着必须
有什么办法可以回去安装旧版本的 Cygwin? 说我想要 1.7.9 版本,但是 setup.exe在 Cygwin 网站上总是指向最新版本? 最佳答案 http://www.cygwin.com/s
我试图从我的C++代码运行这两个.data文件进行分配。我已经获得了所有文件,并且仅打算为程序实现一些功能(所有内容都应能够运行make命令进行编译)。 我曾经运行过MAC,只是刚开始使用Window
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
当我尝试对CVS管理的文件使用Emacs 23.2.1下的ediff-revision时,在*ediff-errors*框架中收到以下错误,而不是直接开始到ediff结果: cygwin warnin
我一直在用 Cygwin (许久)。具体来说,我在Win7上使用它(包括gcc/g++)进行开发工作。我最近才注意到现在存在一个 64-bit version . 我没有特定的需求要求我过渡到 64
我从安装程序 2.905 安装了 cygwin 3.1.7 64 位,如果我不使用 grep --color=always 我在终端中看不到彩色输出,即 grep - -color=auto 在我的终
如何使用 cygwin 挂载软盘镜像文件。我想挂载镜像,将文件复制到挂载的驱动器,然后从命令行卸载它。 我知道你可以使用 Virtual Floppy Drive在 Windows 中,但有没有办法在
这个question说明cygwin的软链接(soft link)和ntfs的junctions有些不同。我希望 cygwin 创建一个真正的连接点。我想过运行mklink但是,见鬼,没有mklink
我想设置一组最小的 cygwin 应用程序(ls、diff、path、find、grep),以便它们在没有完整 cygwin 安装的机器上运行。 我假设我需要的只是相关的 *.exe 文件和 *.dl
我的机器设置可以运行 cmake 和 gcc,我想在构建机器上安装具有完全相同的包和参数集的 cygwin,也可能在其他开发机器上。有没有一种方法可以做到这一点,而不必使用提供的 Setup.exe
我正在尝试使用 Cygwin 运行 Nutch。我在设置 JAVA_HOME 时遇到问题。 $ export JAVA_HOME='/cygdrive/f/program files/java/jd
如果您尝试“全局”安装 Composer,则它无法在 Cygwin 中正确运行。 将 composer.phar 放入/usr/local/bin/composer 中,然后尝试运行它会导致错误: C
要为 Cygwin 安装其他软件包,我是否只需要运行 setup.exe再次从包列表中选择? 此外,就安装 2 个 Cygwin 实例或此类问题而言,这样做不会损害我的计算机(我对这些事情有点菜鸟)。
我刚刚安装了 Cygwin,bash 提示符中的主目录看起来位于我的 Z: 驱动器上。这不是我想要的。 如何更改此设置? 最佳答案 Starting with Cygwin 1.7.34 ,建议的方法
cygwin 上的当前目录是 home/myuser。我导航到 cygwin,发现它有一个名为 home/myuser 的目录,我不知道如何导航到桌面。我不想在那里添加桌面目录,而且我无法在根文件夹
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我使用当前版本的 Cygwin,1.7.9-1。 当我输入“$ which python”时,Cygwin 输出“/usr/bin/python”。 为了确认根目录是我的 Windows 7 文件系统
我想在 Windows 中使用 cmd 做类似的事情: start dir c:\ 应打开一个新控制台,并显示 dir c: 的输出。 对于 Cygwin 我尝试了这个: cmd /c start b
我是一名优秀的程序员,十分优秀!