Followup: bug in g++ headers on Solaris 2.7 with largefile support
Jay F Shachter
jay@m5.chi.il.us
Tue Mar 19 14:25:00 GMT 2002
I reported this bug to this mailing list two days ago. Today I
received a diagnosis of the problem from the ImageMagick mailing list.
Here is the mail I received, which also quotes my original bug report:
This really is a g++ bug! The problem is that when large file support
is enabled, Solaris uses macros to map stdio functions that have
64-bit counterparts to the 64-bit counterparts. The g++ headers
intentionally #undef all stdio macros, but this breaks the Solaris
large file API.
When building ImageMagick, you can work around this problem by adding
--disable-largefile to the configure options.
If you really need largefile support, then you can edit
g++'s std_cstdio.h to comment out the #undefs for the problem
functions.
Bob
On Tue, 19 Mar 2002, Jay F Shachter wrote:
> This was originally sent to gcc-bugs@gcc.gnu.org, but perhaps the
> readers of magick-users@imagemagick.org are a more appropriate
> audience for this question. I don't assert that this is a gcc bug; it
> is more likely that I am doing something wrong, and I hope that you
> can tell me how to fix it.
>
> The ImageMagick "configure" script thinks that my g++ does not support
> either the Standard Template Library, or the ISO C++ standard library.
>
> Here is my output from gcc -v:
>
> Reading specs from /gnu/lib/gcc-lib/sparc-sun-solaris2.7/3.0.3/specs
> Configured with: /gnu/src/gcc-3.0.3/configure --prefix=/gnu --with-gnu-as --with-gnu-ld --with-system-zlib : (reconfigured) /gnu/src/gcc-3.0.3/configure --prefix=/gnu --with-gnu-as --with-gnu-ld --with-system-zlib --enable-languages=c,c++,fortran : (reconfigured) /gnu/src/gcc-3.0.3/configure --prefix=/gnu --with-gnu-as --with-gnu-ld --with-system-zlib --enable-languages=c,c++,fortran,objc : (reconfigured) /gnu/src/gcc-3.0.3/configure --prefix=/gnu --with-gnu-as --with-gnu-ld --with-system-zlib
> Thread model: posix
> gcc version 3.0.3
>
>
> Here are the relevant excerpts from the configure output:
>
> First, the STL test:
>
>
> configure:24704: checking whether the compiler supports Standard Template Library
> configure:24734: g++ -c -O2 -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/src/x/ImageMagick/lcms/src -I/usr/src/x/ImageMagick/ttf/include -I/opt/jay/include -I/usr/openwin/include -I/usr/openwin/include/X11 conftest.cc >&5
> In file included from /gnu/include/g++-v3/cstdio:31,
> from /gnu/include/g++-v3/sparc-sun-solaris2.7/bits/c++io.h:35,
> from /gnu/include/g++-v3/bits/fpos.h:39,
> from /gnu/include/g++-v3/bits/std_iosfwd.h:41,
> from /gnu/include/g++-v3/bits/stl_algobase.h:77,
> from /gnu/include/g++-v3/bits/std_list.h:61,
> from /gnu/include/g++-v3/list:31,
> from configure:24718:
> /gnu/include/g++-v3/bits/std_cstdio.h:97: `fgetpos' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:99: `fopen' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:104: `freopen' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:107: `fsetpos' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:126: `tmpfile' not declared
> configure:24737: $? = 1
> configure: failed program was:
> #line 24717 "configure"
> #include "confdefs.h"
> #include <list>
> #include <deque>
> #ifdef HAVE_NAMESPACES
> using namespace std;
> #endif
> int
> main ()
> {
> list<int> x; x.push_back(5);
> list<int>::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;
> ;
> return 0;
> }
>
>
>
> Second, the ISO test:
>
>
> configure:24639: checking whether the compiler supports ISO C++ standard library
> configure:24669: g++ -c -O2 -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/src/x/ImageMagick/lcms/src -I/usr/src/x/ImageMagick/ttf/include -I/opt/jay/include -I/usr/openwin/include -I/usr/openwin/include/X11 conftest.cc >&5
> In file included from /gnu/include/g++-v3/cstdio:31,
> from /gnu/include/g++-v3/sparc-sun-solaris2.7/bits/c++io.h:35,
> from /gnu/include/g++-v3/bits/fpos.h:39,
> from /gnu/include/g++-v3/bits/std_iosfwd.h:41,
> from /gnu/include/g++-v3/bits/std_ios.h:39,
> from /gnu/include/g++-v3/bits/std_ostream.h:39,
> from /gnu/include/g++-v3/bits/std_iostream.h:40,
> from /gnu/include/g++-v3/iostream:31,
> from configure:24653:
> /gnu/include/g++-v3/bits/std_cstdio.h:97: `fgetpos' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:99: `fopen' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:104: `freopen' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:107: `fsetpos' not declared
> /gnu/include/g++-v3/bits/std_cstdio.h:126: `tmpfile' not declared
> configure:24672: $? = 1
> configure: failed program was:
> #line 24652 "configure"
> #include "confdefs.h"
> #include <iostream>
> #include <map>
> #include <iomanip>
> #ifdef HAVE_NAMESPACES
> using namespace std;
> #endif
> int
> main ()
> {
> return 0;
> ;
> return 0;
> }
>
>
>
> I went to ftp.gnu.org and retrieved the most recent version of
> libstdc++ and determined that it was version 2.90.8; and for that
> reason, I did not install it, because the version of libstdc++
> currently on my system is version 3.0.2 (apparently libstdc++ is now
> incorporated into gcc, and is no longer updated as a separate product).
> Why is g++ generating the above compile-time errors, which lead
> configure to conclude that I have neither STD nor ISO C++, and what
> must I do to produce successful compilation of the test programs?
> I thank you in advance for your reply.
>
> Jay F. Shachter
> 6424 N Whipple St
> Chicago IL 60645-4111
> (1-773)7613784
> jay@m5.chi.il.us
> _______________________________________________
> Magick-users mailing list
> Magick-users@imagemagick.org
Jay F. Shachter
6424 N Whipple St
Chicago IL 60645-4111
(1-773)7613784
jay@m5.chi.il.us
More information about the Gcc-bugs
mailing list