You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@stdcxx.apache.org by Winon <wm...@gmail.com> on 2013/01/08 18:09:41 UTC

error compiling on linux

When trying to compile the svn trunk on linux 64 bit with gcc 4.7.2 
(Debian 4.7.2-17), I get an error with a previous declaration of 
__mbstate_t.

Does anyone have any suggestions for fixing this?


This is the command line I am using to compile
  make BUILDDIR=/home/win/stdcxx_rsvn BUILDMODE=12D CONFIG=gcc.config
and this is a cut and paste of the error.

gcc -c -I/home/win/apache-stdcxx/include/ansi 
-I/home/win/apache-stdcxx/include -I/home/win/stdcxx_rsvn/include 
-pedantic -nostdinc++  -W -Wall -Wcast-qual -Winline -Wshadow 
-Wwrite-strings -Wno-long-long -Wcast-align 
/home/win/apache-stdcxx/src/assert.cpp
In file included from /home/win/apache-stdcxx/include/ansi/wchar.h:201:0,
                  from /usr/include/_G_config.h:20,
                  from /usr/include/libio.h:32,
                  from /usr/include/../include/stdio.h:74,
                  from /home/win/apache-stdcxx/include/ansi/stdio.h:92,
                  from /home/win/apache-stdcxx/src/assert.cpp:32:
/home/win/apache-stdcxx/include/rw/_mbstate.h:146:3: error: conflicting 
declaration 'typedef struct __mbstate_t __mbstate_t'
In file included from /home/win/apache-stdcxx/include/ansi/wchar.h:199:0,
                  from /usr/include/_G_config.h:20,
                  from /usr/include/libio.h:32,
                  from /usr/include/../include/stdio.h:74,
                  from /home/win/apache-stdcxx/include/ansi/stdio.h:92,
                  from /home/win/apache-stdcxx/src/assert.cpp:32:
/usr/include/../include/wchar.h:94:3: error: '__mbstate_t' has a 
previous declaration as 'typedef struct __mbstate_t __mbstate_t'


Thanks,
Win

Re: error compiling on linux

Posted by Liviu Nicoara <ni...@hates.ms>.
On 01/08/13 12:09, Winon wrote:
> When trying to compile the svn trunk on linux 64 bit with gcc 4.7.2
> (Debian 4.7.2-17), I get an error with a previous declaration of
> __mbstate_t.

Unfortunately, I could not reproduce the error on my Debian:

$ uname -a; gcc -v
Linux debbie 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 
GNU/Linux
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' 
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-4.4 --enable-shared --enable-multiarch 
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix 
--with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib 
--enable-nls --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-objc-gc --with-arch-32=i586 --with-tune=generic 
--enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)

I built the library using (custom-built) gcc 4.7.2 as well:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=...
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7.2/configure --prefix=/opt/gcc/4_7_2 
--enable-threads=posix --enable-languages=c,c++,objc --enable-shared 
--disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp 
--enable-lto --with-gnu-ld --verbose --enable-multilib
Thread model: posix
gcc version 4.7.2 (GCC)

Please be advised that BUILDMODE is different than BUILDTYPE, see top 
GNUmakefile in trunk.

Liviu