1833788 Members
2254 Online
110063 Solutions
New Discussion

Re: strange ld error

 
minglei yuan
Occasional Contributor

strange ld error

when I compiling following codes, I got a ld error:
"Unsatisfied symbols: typeinfo for eaException"

try {
.....
} catch (::eaException& ea) {
cout << ea.getId() ;
return -1;
}

I have made sure the eaException lib was linked with -leaException option, and it can be proved by successfully compiling following code:
int main() {
eaException ex;
ex.getId();
}

So, my question is:
Is there any difference in c++ when use a exception class in "try.. catch.." expression or declare as a normal variable?
why the ld can't find eaException properly?
3 REPLIES 3
minglei yuan
Occasional Contributor

Re: strange ld error

by the way, I am using gcc 3.2.3 on hp11
minglei yuan
Occasional Contributor

Re: strange ld error

So happy that I find solution by myself.
The problem is exception handling in g++ is still under development. Refer to this url(http://theoryx5.uwinnipeg.ca/gnu/gcc/gxxint_13.html) for detail.
To slove the problem, use compilee option -fno-rtti
Martin Johnson
Honored Contributor

Re: strange ld error

Too bad you can't assign points to yourself.

:-)
Marty