[odb-users] ODB fails to compile if GCC doesn't support NLS

Stath Paul pstath at axxcelera.com
Fri Feb 15 13:58:24 EST 2013


Boris --

I have found that ODB doesn't compile if the compiler you are using doesn't support NLS.

I'm attempting to compile odb-2.2.0 from source.

The GCC compiler I'm using was compiled w/o NLS support by throwing the "--disable-nls" switch during the configure process.
I discovered this issue while trying to set up a BitBake recipe to compile ODB as part of an embedded Yocto based distribution.

By default, GCC is compiled with NLS support.  (--enable-nls)
If the configure script detects that GCC is being built as a cross compiler, it defaults to --disable-nls.

I was able to recreated the issue outside the Yocto build environment by compiling GCC w/o NLS support.
Here is the output from "/opt/gcc-no-nls/bin/g++ -v"

Using built-in specs.
COLLECT_GCC=/opt/gcc-no-nls/bin/g++
COLLECT_LTO_WRAPPER=/opt/gcc-no-nls/libexec/gcc/i686-pc-linux-gnu/4.7.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure --disable-nls --prefix=/opt/gcc-no-nls
Thread model: posix
gcc version 4.7.2 (GCC)

I configured the build of ODB to use this compiler using:

./configure --with-gxx-name=/opt/gcc-no-nls/bin/g++ CXX=/opt/gcc-n0-nls/bin/g++

When I run make, I'm getting the following error:

libtool: compile:  /opt/gcc-no-nls/bin/g++ -DHAVE_CONFIG_H -I.. -I.. -I/opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/plugin/include -I/home/pstath/src/libcutl-1.7.1 -g -O2 -MT instance.lo -MD -MP -MF .deps/instance.Tpo -c instance.cxx  -fPIC -DPIC -o .libs/instance.o
depbase=`echo include.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/bash ../libtool --tag=CXX   --mode=compile /opt/gcc-no-nls/bin/g++ -DHAVE_CONFIG_H   -I'..' -I'..' -I/opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/plugin/include -I/home/pstath/src/libcutl-1.7.1  -g -O2 -MT include.lo -MD -MP -MF $depbase.Tpo -c -o include.lo include.cxx &&\
	mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /opt/gcc-no-nls/bin/g++ -DHAVE_CONFIG_H -I.. -I.. -I/opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/plugin/include -I/home/pstath/src/libcutl-1.7.1 -g -O2 -MT include.lo -MD -MP -MF .deps/include.Tpo -c include.cxx  -fPIC -DPIC -o .libs/include.o
In file included from /opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/messages_members.h:37:0,
                 from /opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_facets_nonio.h:1898,
                 from /opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/locale:43,
                 from include.cxx:9:
/usr/include/libintl.h:40:14: error: expected unqualified-id before '__const'
/usr/include/libintl.h:40:14: error: expected ')' before '__const'
/usr/include/libintl.h:40:14: error: expected initializer before '__const'
/usr/include/libintl.h:64:43: error: new declaration 'char* fake_ngettext(const char*, const char*, long unsigned int)'
In file included from ../odb/gcc.hxx:44:0,
                 from include.cxx:5:
/opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/plugin/include/intl.h:46:20: error: ambiguates old declaration 'const char* fake_ngettext(const char*, const char*, long unsigned int)'
In file included from /opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/i686-pc-linux-gnu/bits/messages_members.h:37:0,
                 from /opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_facets_nonio.h:1898,
                 from /opt/gcc-no-nls/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/locale:43,
                 from include.cxx:9:
/usr/include/libintl.h:83:14: error: expected unqualified-id before '__const'
/usr/include/libintl.h:83:14: error: expected ')' before '__const'
/usr/include/libintl.h:83:14: error: expected initializer before '__const'
/usr/include/libintl.h:87:14: error: expected unqualified-id before '__const'
/usr/include/libintl.h:87:14: error: expected ')' before '__const'
/usr/include/libintl.h:87:14: error: expected initializer before '__const'
make[2]: *** [include.lo] Error 1

I was able to correct the issue by making a slight modification to odb/gcc.hxx.

One can either remove the "#include <intl.h>" on line 44,

or

Modify the line to be "#include <libintl.h>".

>From what I can tell, odb is not internationalized.
Is there a need to include <intl.h> (or <libintl.h>) at all?

--
Paul Stath
Senior Software Engineer
Axxcelera Broadband Wireless



More information about the odb-users mailing list