[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Exceptions failing in libstdc++
From: |
red floyd |
Subject: |
Re: Exceptions failing in libstdc++ |
Date: |
Tue, 22 Mar 2005 19:34:26 GMT |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
The issue is a bad LD_LIBRARY_PATH.
I had installed MATLAB R14SP2, which comes with its own copy of
libstdc++.so.5, and their installation instructions cause that to be
selected over the stock libstdc++, and their library causes the error.
When I unset my LD_LIBRARY_PATH, and got the default paths, amazingly
enough, it worked.
Time to go bug MATLAB (but I may not be under maintenance :( )
Here's my ld.so.conf:
/usr/kerberos/lib
/usr/X11R6/lib
/usr/lib/mysql
/opt/perl-Qt/lib
/usr/lib/qt-3.1/lib
/usr/local/lib
/usr/local/xerces-c-src_2_5_0/lib
Here's my LD_LIBRARY_PATH (/usr/local/matlab is the MATLAB install
directory (broken up for clarity, and yes, there *is* a leading ':' on
the first entry)
:/usr/local/matlab/sys/os/glnx86
:/usr/local/matlab/bin/glnx86
:/usr/local/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/native_threads
:/usr/local/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client
:/usr/local/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386
:/usr/local/xerces-c-src_2_5_0/lib
Code reproducing the problem attached:
//-- cut here
#include <iostream>
#include <string>
class X {
const char *f_;
int l_;
std::string s_;
public:
X(const char *f, int l, const std::string& s)
: f_(f){ }
virtual ~X() { }
};
void g()
{
throw X(__FILE__,__LINE__,std::string("haha"));
}
void *f(void *p)
{
try
{
g();
}
catch(X&)
{
std::cout << "caught X in f(" << p << ")" << std::endl;
}
return 0;
}
int main()
{
f(0);
return 0;
}