This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
mbstate_t vs. __mbstate_t?
- To: libc-alpha at sources dot redhat dot com
- Subject: mbstate_t vs. __mbstate_t?
- From: Craig Rodrigues <rodrigc at mediaone dot net>
- Date: Fri, 16 Feb 2001 00:33:24 -0500
Hi,
I posted the following message to the libstdc++ mailing list:
http://gcc.gnu.org/ml/libstdc++/2001-02/msg00100.html
If libstdc++-v3 is compiled on a glibc 2.1 system, there are a lot
of symbols stored in the library which reference "mbstate_t", eg.
00053288 W std::istream::seekg(std::fpos<mbstate_t>)
However, if you use this libstdc++.so on a system which has
been upgraded to glibc 2.2.1, you will obtain link errors because
mbstate_t is now a typedef for __mbstate_t:
#include <iostream>
using namespace std;
void seek(istream& i)
{
unsigned long pos = 35;
i.seekg(pos);
}
int main(int, char **) { return 0; }
% g++ d.cc
/tmp/ccx9JhBd.o: In function `seek(std::istream&)':
/tmp/ccx9JhBd.o(.text+0x3c): undefined reference to `std::istream::seekg(std::fpos<__mbstate_t>)'
collect2: ld returned 1 exit status
Is this a known difference between glibc 2.1 and glibc 2.2?
Should the libstdc++ people do something to prevent this binary
incompatibility in their libstdc++.so.3 library between glibc 2.1 and
glibc 2.2?
I apologize if this is not relevant to this list, but it does concern
glibc, and I did not get a response on the libstdc++ mailing list.
Thank you.
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net