This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Using gcc with libraries built with Sun's compiler


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]