Question

I'm trying to create a cross compiling setup that will allow me to compile programs for Linux, Windows, Mac, and Android. At the moment, though, I'm running into an issue I don't know how to resolve and I figured it was time to ask for help.

I have successfully built libiconv using:

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

When I try the same thing for gettext it configures everything, but I get the following when I try to make:

../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

Here is a link to the configure log file for the gettext library.

The goal is to compile glib myself so I have the same source code being used for all of the platforms that I wish to target. Any help you can provide is greatly appreciated.

System information:

Operating System: Ubuntu 12.04 LTS.

I have installed the mingw32 package.

I have downloaded the source for glib, gettext, and libiconv.

My environment configuration is setup as:

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
Was it helpful?

Solution

I figured it out. This is actually caused by a bug with gettext's build. Here is the bug report.

The easy work around is to do the following prior to configuring gettext.

export CFLAGS="$CFLAGS -O2" 
export CXXFLAGS="$CXXFLAGS -O2"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top