What version of gcc do I need to build LibreOffice?

I’m using gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) on Ubuntu 12.04. When I pull the latest code from the repository using ‘git pull -r’ and rerun autogen, make then fails with compiler errors:

[build RDB] scriptproviderforjavascript
In file included from /home/richard_git/libo3/include/rtl/string.hxx:32:0,
                 from /home/richard_git/libo3/include/rtl/ustring.hxx:31,
                 from /home/richard_git/libo3/registry/tools/fileurl.hxx:23,
                 from /home/richard_git/libo3/registry/tools/fileurl.cxx:20:
/home/richard_git/libo3/include/rtl/stringutils.hxx:78:20: sorry, unimplemented: non-static data member initialisers
/home/richard_git/libo3/include/rtl/stringutils.hxx:84:18: error: expected unqualified-id before ‘using’
In file included from /home/richard_git/libo3/registry/tools/fileurl.hxx:23:0,
                 from /home/richard_git/libo3/registry/tools/fileurl.cxx:20:
/home/richard_git/libo3/include/rtl/ustring.hxx: In constructor ‘rtl::OUString::OUString(char)’:
/home/richard_git/libo3/include/rtl/ustring.hxx:170:9: error: type ‘rtl::OUString’ is not a direct base of ‘rtl::OUString’
In file included from /home/richard_git/libo3/registry/tools/fileurl.hxx:23:0,
                 from /home/richard_git/libo3/registry/tools/fileurl.cxx:20:
/home/richard_git/libo3/include/rtl/ustring.hxx: At global scope:
/home/richard_git/libo3/include/rtl/ustring.hxx:2797:14: error: ‘rtl::OUStringLiteral1’ has not been declared
make[1]: *** [/home/richard_git/libo3/workdir/CxxObject/registry/tools/fileurl.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [build] Error 2

As the cascade of errors starts with an apology, I assume my problem lies in the choice of compiler.

I run autogen thus:

./autogen.sh --enable-dbgutil --with-lang=‘en-GB th’ --disable-gtk3 --disable-gstreamer-1-0

I presume I’m building LibreOffice

Perhaps some help in the official page:

Building on Linux

I couldn’t find any mention of gcc version there. LibreOffice Version 4.4.4 builds straightforwardly with gcc 4.6.3, though I should probably examine the compilation logs. I fell asleep watching it compile!

Then maybe better ask in:

Development ML

There are debugger issues. The version of gdb, on Ubuntu 12.04, is 7.4, and it doesn’t work with the default settings of g++ 4.8 - symbols are not available for local variables. There’s a discussion of solutions at http://stackoverflow.com/questions/19129706/c-app-on-ubuntu-after-installing-gcc-4-8-1-the-gdb-does-not-work . I’ve installed gdb Version 7.6.2 straight from GNU and it seems to be working. I’ve made it the version for /usr/bin/gdb.

The Ubuntu tarball for LibreOffice builds with gcc 4.6.3 and g++ 4.6.4.

I’ve asked on the development list. From some point beyond, a later version is required. Currently at least Version 4.7 is required, though it is likely that Version 4.8 may soon be needed. Instructions for installation in Ubuntu 12.04 (Precise) may be found at http://askubuntu.com/questions/271388/how-to-install-gcc-4-8 . Remember also to install g+±4.8, in exactly the same manner.

I haven’t checked for debugger compatibility issues.

One doesn’t have to make them the default compiler version. One can ensure that environmental variables CC and CXX are set to specify the compilers when running autogen, e.g. my latest command

CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./autogen.sh --enable-dbgutil --with-lang='en-GB th' --disable-gtk3 --disable-gstreamer-1-0

The same will apply to running configure.