This is the mail archive of the gcc@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]

Using gcc with libraries built with Sun's compiler


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.  If I do
not link to the Merant library the
program runs fine.   The Merant library is compiled using one of sun's
compilers.

The problems occurs when we create this class which is inherited from the
string class.
I am lead to believe the actual problems is in resolving  symbols that are
generated from 
two different compilers.

This works
class AString {
public:
  AString();
};

This will cause the error
class AString : public string
{
public:
  AString();
};


Below is information about the compiler environment.

Compiler: gcc 2.95.2
Operating system: Sun  sparc 5.8
Compiler command: g++ -fPIC -g -o demoodbc -I/opt/merant/include
AnsiString.cpp demoodbc.c -L/opt/merant/lib -lodbc -lodbcinst -lstdc++

Here is a stack trace of what happens.
Program received signal SIGSEGV, Segmentation fault.
0xff029218 in __0fKunsafe_iosEinitP6Jstreambuf () from /usr/lib/libC.so.5
(gdb) bt
#0  0xff029218 in __0fKunsafe_iosEinitP6Jstreambuf () from
/usr/lib/libC.so.5
#1  0xff03063c in __0oSistream_withassignasP6Jstreambuf ()
   from /usr/lib/libC.so.5
#2  0xff02a8e4 in __0oNIostream_initctv () from /usr/lib/libC.so.5
#3  0xff048f18 in _init () from /usr/lib/libC.so.5
#4  0xff3ca7d8 in ?? ()
#5  0xff3ca620 in ?? ()
#6  0xff3d3350 in ?? ()
#7  0xff3c298c in ?? ()
(gdb) 



jadomaitis@us.gaussinterprise.com
Gauss Interprise
Manage all of your content!
Tel: 949-784-8000  
Fax: 949-784-8200
www.gaussinterprise.com 



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