Enabling exceptions and stuff

bridged with qdn.public.qnxrtp.devtools
Post Reply
Bill Caroselli

Enabling exceptions and stuff

Post by Bill Caroselli » Mon Oct 27, 2003 8:54 pm

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!

Colin Burgess

Re: Enabling exceptions and stuff

Post by Colin Burgess » Mon Oct 27, 2003 9:14 pm

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

Steve Reid

Re: Enabling exceptions and stuff

Post by Steve Reid » Mon Oct 27, 2003 9:53 pm

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
------------------------------------------

Bill Caroselli

Re: Enabling exceptions and stuff

Post by Bill Caroselli » Mon Oct 27, 2003 10:12 pm

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!

John Nagle

Re: Enabling exceptions and stuff

Post by John Nagle » Tue Oct 28, 2003 8:20 pm

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!

Colin Burgess

Re: Enabling exceptions and stuff

Post by Colin Burgess » Tue Oct 28, 2003 9:25 pm

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

Bill Caroselli

Re: Enabling exceptions and stuff

Post by Bill Caroselli » Tue Oct 28, 2003 10:42 pm

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.

Post Reply

Return to “qdn.public.qnxrtp.devtools”