C++ and 6.1,,,help

I have a number of small projects which previously compiled with no warnings
before installing 6.1.

I use a very simple make file with no options to build these projects, all
are files use .cpp extension

Now I cannot compile any of them without:

/usr/include/stblib.h:239: `abort’ is already declared in this scope

I’ve check the obvious, looking for pre-processors to ensure the header does
not get used more than once, I’m stumped…what has changed?


For and on behalf of
Vosper Thornycroft Controls Ltd (VTC)
Simon Platten

A VOSPER THORNYCROFT COMPANY
Registered Office: Victoria Road, Woolston, Southampton, SO19 9RR
Registered in England and Wales No:2766255

Simon Platten <simon.platten@brisco-eng.co.uk> wrote:
: I have a number of small projects which previously compiled with no warnings
: before installing 6.1.

: I use a very simple make file with no options to build these projects, all
: are files use .cpp extension

: Now I cannot compile any of them without:

: /usr/include/stblib.h:239: `abort’ is already declared in this scope

: I’ve check the obvious, looking for pre-processors to ensure the header does
: not get used more than once, I’m stumped…what has changed?

6.1 uses Dikum C++ now, not GNU. Post of test case of your problem, to help
identify and possibly remedy if it is a bug on our side.

The following code compiles fine on my 6.1 box.

foo.cc________
#include <stdlib.h>

int main(void)
{
}

QCC -o foo foo.cc

-----Original Message-----
From: Simon Platten [mailto:simon.platten@brisco-eng.co.uk]
Posted At: Thursday, August 30, 2001 2:08 AM
Posted To: devtools
Conversation: C++ and 6.1,help
Subject: C++ and 6.1,help


I have a number of small projects which previously compiled with no
warnings
before installing 6.1.

I use a very simple make file with no options to build these projects,
all
are files use .cpp extension

Now I cannot compile any of them without:

/usr/include/stblib.h:239: `abort’ is already declared in this scope

I’ve check the obvious, looking for pre-processors to ensure the header
does
not get used more than once, I’m stumped…what has changed?


For and on behalf of
Vosper Thornycroft Controls Ltd (VTC)
Simon Platten

A VOSPER THORNYCROFT COMPANY
Registered Office: Victoria Road, Woolston, Southampton, SO19 9RR
Registered in England and Wales No:2766255

Having copied a makefile from a photon project and modified the relevant
areas, it appears the C++ library is not being used with the cpp files,
adding -l cpp resolves all errors.

“Rennie Allen” <RAllen@csical.com> wrote in message
news:64F00D816A85D51198390050046F80C9A52A@exchangecal.hq.csical.com

The following code compiles fine on my 6.1 box.

foo.cc________
#include <stdlib.h

int main(void)
{
}

QCC -o foo foo.cc

-----Original Message-----
From: Simon Platten [mailto:> simon.platten@brisco-eng.co.uk> ]
Posted At: Thursday, August 30, 2001 2:08 AM
Posted To: devtools
Conversation: C++ and 6.1,help
Subject: C++ and 6.1,help


I have a number of small projects which previously compiled with no
warnings
before installing 6.1.

I use a very simple make file with no options to build these projects,
all
are files use .cpp extension

Now I cannot compile any of them without:

/usr/include/stblib.h:239: `abort’ is already declared in this scope

I’ve check the obvious, looking for pre-processors to ensure the header
does
not get used more than once, I’m stumped…what has changed?


For and on behalf of
Vosper Thornycroft Controls Ltd (VTC)
Simon Platten

A VOSPER THORNYCROFT COMPANY
Registered Office: Victoria Road, Woolston, Southampton, SO19 9RR
Registered in England and Wales No:2766255

Simon Platten wrote:

Having copied a makefile from a photon project and modified the relevant
areas, it appears the C++ library is not being used with the cpp files,
adding -l cpp resolves all errors.

I have had the same problem myself when compiling under 6.1, as a fact
I’ve had this problem with ALL QNX 6.1 installations that I have done

The cause for the “llready defined” are the lines:

#ifndef __GCC_BUILTIN
using std::abort, using std::abs;
using std::exit, using std::labs;
#endif

(lines 238-242) in stdlib.h

so it seems __GCC_BUILTIN is not defined because of some reason

This only happens when using g++ to compile, gcc works properly