Enabling exceptions and stuff

I was trying to test a program that used exceptins and it keeps:
Abort (core dumped)

I trimmed the program down to:

int main ( )
{
int x = 25;
try
{
throw x;
}
catch ( int i )
{
}
return 0;
}

And it still dumps. I have added -fexceptions to the compile and
link lines. What must I do to enable exceptions?


I read here that the Dinkum Libs support exceptions better than the
standard C++ libs. What must I do to compile and linkagainst the
Dinkum libs?

Where in the docs should I find this info? I swear I looked!

The key is in the linking - use -lang-c++ in your link line.

Bill Caroselli <qtps@earthlink.net> wrote:

I was trying to test a program that used exceptins and it keeps:
Abort (core dumped)

I trimmed the program down to:

int main ( )
{
int x = 25;
try
{
throw x;
}
catch ( int i )
{
}
return 0;
}

And it still dumps. I have added -fexceptions to the compile and
link lines. What must I do to enable exceptions?


I read here that the Dinkum Libs support exceptions better than the
standard C++ libs. What must I do to compile and linkagainst the
Dinkum libs?

Where in the docs should I find this info? I swear I looked!


cburgess@qnx.com

Colin Burgess <cburgess@qnx.com> wrote:
: The key is in the linking - use -lang-c++ in your link line.

: Bill Caroselli <qtps@earthlink.net> wrote:

:> Where in the docs should I find this info? I swear I looked!

I’ve mentioned -lang-c++ in the docs for gcc. I’ve also added some index
entries.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

OK. I found the -lang-c++ on the link line. That helped, some.


Bill Caroselli <qtps@earthlink.net> wrote:

BC > I was trying to test a program that used exceptins and it keeps:
BC > Abort (core dumped)

BC > I trimmed the program down to:

BC > int main ( )
BC > {
BC > int x = 25;
BC > try
BC > {
BC > throw x;
BC > }
BC > catch ( int i )
BC > {
BC > }
BC > return 0;
BC > }

BC > And it still dumps. I have added -fexceptions to the compile and
BC > link lines. What must I do to enable exceptions?

BC > -----

BC > I read here that the Dinkum Libs support exceptions better than the
BC > standard C++ libs. What must I do to compile and linkagainst the
BC > Dinkum libs?

BC > Where in the docs should I find this info? I swear I looked!

Did you compile everything with QCC, rather than qcc or gcc?

John Nagle

Bill Caroselli wrote:

I was trying to test a program that used exceptins and it keeps:
Abort (core dumped)

I trimmed the program down to:

int main ( )
{
int x = 25;
try
{
throw x;
}
catch ( int i )
{
}
return 0;
}

And it still dumps. I have added -fexceptions to the compile and
link lines. What must I do to enable exceptions?


I read here that the Dinkum Libs support exceptions better than the
standard C++ libs. What must I do to compile and linkagainst the
Dinkum libs?

Where in the docs should I find this info? I swear I looked!

FYI, QCC is equivalent to qcc -lang-c++

John Nagle <nagle@downside.com> wrote:

Did you compile everything with QCC, rather than qcc or gcc?

John Nagle

Bill Caroselli wrote:
I was trying to test a program that used exceptins and it keeps:
Abort (core dumped)

I trimmed the program down to:

int main ( )
{
int x = 25;
try
{
throw x;
}
catch ( int i )
{
}
return 0;
}

And it still dumps. I have added -fexceptions to the compile and
link lines. What must I do to enable exceptions?


I read here that the Dinkum Libs support exceptions better than the
standard C++ libs. What must I do to compile and linkagainst the
Dinkum libs?

Where in the docs should I find this info? I swear I looked!


cburgess@qnx.com

Colin Burgess <cburgess@qnx.com> wrote:
CB > FYI, QCC is equivalent to qcc -lang-c++

CB > John Nagle <nagle@downside.com> wrote:

Did you compile everything with QCC, rather than qcc or gcc?

John Nagle

I had failed to link with -lang-c++. But I did find this already.

Thanks to all.