Как выполнить перекрестную компиляцию gettext с mingw32 для Windows

Я пытаюсь создать установку кросс-компиляции, которая позволит мне компилировать программы для Linux, Windows, Mac и Android. Однако на данный момент я столкнулся с проблемой, которую не знаю, как решить, и я решил, что пришло время обратиться за помощью.

Я успешно построил libiconv, используя:

./configure --build=x86_64-linux-gnu --host=i586-mingw32msvc --prefix=/opt/crosslibs/windows/ --enable-shared --enable-static
make
make install

Когда я пытаюсь сделать то же самое для gettext, он настраивает все, но при попытке сделать я получаю следующее:

../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 самостоятельно, чтобы у меня был один и тот же исходный код, используемый для всех платформ, на которые я хочу ориентироваться. Любая помощь, которую вы можете оказать, очень ценится.

Информация о системе:

Операционная система: Ubuntu 12.04 LTS.

Я установил пакет mingw32.

Я скачал исходный код для glib, gettext и libiconv.

Моя конфигурация среды настроена как:

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

person Jason Smith    schedule 18.12.2013    source источник


Ответы (1)


Я понял. На самом деле это вызвано ошибкой в ​​сборке gettext. Вот отчет об ошибке.

Простой обходной путь заключается в том, чтобы сделать следующее перед настройкой gettext.

export CFLAGS="$CFLAGS -O2" 
export CXXFLAGS="$CXXFLAGS -O2"
person Jason Smith    schedule 18.12.2013