首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将mingw32与windows的gettext交叉编译

如何将mingw32与windows的gettext交叉编译
EN

Stack Overflow用户
提问于 2013-12-18 00:00:31
回答 1查看 1.5K关注 0票数 1

我正在尝试创建一个交叉编译设置,允许我为Linux、Windows、Mac和Android编译程序。然而,目前,我遇到了一个我不知道如何解决的问题,我觉得是时候寻求帮助了。

我已经成功地建造了libiconv,使用:

代码语言:javascript
复制
./configure --build=x86_64-linux-gnu --host=i586-mingw32msvc --prefix=/opt/crosslibs/windows/ --enable-shared --enable-static
make
make install

当我尝试对gettext进行相同的操作时,它会配置所有内容,但当我尝试创建以下内容时,会得到如下结果:

代码语言:javascript
复制
../woe32dll/.libs/c++html-styled-ostream.o: In function `html_styled_ostream(float, long double,...)(...)':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/html-styled-ostream.oo.c:70: undefined reference to `html_ostream_free(any_ostream_representation*)'
../woe32dll/.libs/c++html-styled-ostream.o: In function `html_styled_ostream_create':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/html-styled-ostream.oo.c:143: undefined reference to `ostream_write_mem(any_ostream_representation*, void const*, unsigned int)'
../woe32dll/.libs/c++html-styled-ostream.o: In function `html_styled_ostream__end_use_class':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/html-styled-ostream.oo.c:88: undefined reference to `html_ostream_end_span(any_ostream_representation*, char const*)'
../woe32dll/.libs/c++html-styled-ostream.o: In function `html_styled_ostream__begin_use_class':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/html-styled-ostream.oo.c:81: undefined reference to `html_ostream_begin_span(any_ostream_representation*, char const*)'
../woe32dll/.libs/c++html-styled-ostream.o: In function `html_styled_ostream__flush':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/html-styled-ostream.oo.c:64: undefined reference to `html_ostream_flush(any_ostream_representation*)'
../woe32dll/.libs/c++html-styled-ostream.o: In function `html_styled_ostream__write_mem':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/html-styled-ostream.oo.c:58: undefined reference to `html_ostream_write_mem(any_ostream_representation*, void const*, unsigned int)'
../woe32dll/.libs/c++term-styled-ostream.o: In function `style_compute_color_value':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:308: undefined reference to `term_ostream_rgb_to_color(any_ostream_representation*, int, int, int)'
../woe32dll/.libs/c++term-styled-ostream.o: In function `term_styled_ostream(float, long double,...)(...)':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:107: undefined reference to `term_ostream_free(any_ostream_representation*)'
../woe32dll/.libs/c++term-styled-ostream.o: In function `term_styled_ostream__write_mem':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:89: undefined reference to `term_ostream_set_color(any_ostream_representation*, int)'
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:90: undefined reference to `term_ostream_set_bgcolor(any_ostream_representation*, int)'
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:91: undefined reference to `term_ostream_set_weight(any_ostream_representation*, term_weight_t)'
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:92: undefined reference to `term_ostream_set_posture(any_ostream_representation*, term_posture_t)'
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:93: undefined reference to `term_ostream_set_underline(any_ostream_representation*, term_underline_t)'
../woe32dll/.libs/c++term-styled-ostream.o: In function `term_styled_ostream_create':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:615: undefined reference to `term_ostream_free(any_ostream_representation*)'
../woe32dll/.libs/c++term-styled-ostream.o: In function `term_styled_ostream__flush':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:101: undefined reference to `term_ostream_flush(any_ostream_representation*)'
../woe32dll/.libs/c++term-styled-ostream.o: In function `term_styled_ostream__write_mem':
/opt/crosslibs/windows/source/gettext-0.18.3.1/gettext-tools/gnulib-lib/term-styled-ostream.oo.c:95: undefined reference to `term_ostream_write_mem(any_ostream_representation*, void const*, unsigned int)'
collect2: ld returned 1 exit status
make[4]: *** [libgettextlib.la] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

这里有一个指向gettext库的配置日志文件的链接。

我们的目标是自己编译glib,这样我就可以将相同的源代码用于我希望针对的所有平台。我们非常感谢您能提供的任何帮助。

系统信息:

操作系统:Ubuntu12.04 LTS。

我安装了mingw32包

我已经下载了滑翔gettext利比索诺夫的源代码。

我的环境配置设置为:

代码语言:javascript
复制
CFLAGS="-I/opt/crosslibs/windows/include"
CPPFLAGS="-I/opt/crosslibs/windows/include"
LDFLAGS="-L/opt/crosslibs/windows/lib"
XDG_DATA_DIRS="/opt/crosslibs/windows/share"

CC=i586-mingw32msvc-gcc
CXX=i586-mingw32msvc-g++
LD=i586-mingw32msvc-ld
RANLIB=i586-mingw32msvc-ranlib
AR=i586-mingw32msvc-ar
AS=i586-mingw32msvc-as
STRIP=i586-mingw32msvc-strip

export CFLAGS
export CPPFLAGS
export LDFLAGS
export XDG_DATA_DIRS

export CC
export CXX
export LD
export RANLIB
export AR
export AS
export STRIP
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-18 04:36:14

我想通了。这实际上是由gettext的构建中的一个bug引起的。这是错误报告

简单的工作是在配置gettext之前执行以下操作。

代码语言:javascript
复制
export CFLAGS="$CFLAGS -O2" 
export CXXFLAGS="$CXXFLAGS -O2"
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20647171

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档