This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Using gcc with libraries built with Sun's compiler
- To: John Adomaitis <jadomaitis at us dot gaussinterprise dot com>
- Subject: Re: Using gcc with libraries built with Sun's compiler
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 05 Jun 2001 18:38:22 -0300
- Cc: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <7D705AFD2BCDD411AF420002555893971382E7@mailsrv2.magellan.com>
On Jun 5, 2001, John Adomaitis <jadomaitis@us.gaussinterprise.com> wrote:
> The problem we are having is when we compile and link with a Merant
> odbc library with gcc on Sun it generates a segmentation fault when
> we invoke the executable.
I'm afraid you're in trouble. In general, you can't link into the
same program C++ libraries created by different compilers. The
problem is that the C++ standard libraries of both compilers will
attempt to initialize their notions of cin, cout and cerr, but since
the compilers use different representations, one of them will crash.
Try linking statically with libstdc++.a, and avoid at all costs
bringing in cin, cout and cerr from it.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me