stdlib.h woes

I’ve freshly installed QNX6.1 + patchA development stuff.
And to my amezement this simplest piece of code cannot be compiled.

#include <stdlib.h>

int main(void)
{
return 0;
}

gcc -o xtest xtest.cpp
/usr/include/stdlib.h 239: ‘abort’ is already included

/usr/include/stdlib.h 239: ‘abs’ is already included
/usr/include/stdlib.h 239: ‘exit’ is already included
/usr/include/stdlib.h 239: ‘labs’ is already included

What is that? Is it a new feature?

Well, I found that if I either defined __GCC_BUILTIN or used
I could get rid of this error. I don’t reckon that it makes sence to replace
stdlib.h with cstdlib in all src files, so that defining __GCC_BUILTIN seems
to be ok but I did not find any info about this define.
If anyone can point to it I’d appreciate.

cheers,
Igor

I had this problem too. Colin posted the fix in another news group, but is
now probably lost in the mists of time_t. That being said, here is the fix.

In /usr/lib/gcc-lib/ntox86/2.95.2/ directory, edit the *cc1plus entry to of
specs to the following:

*cc1plus:
%(cc1plus_spec) -fhonor-std -fno-builtin

Cheers
-Brian

+===================================+
Brian K. Hlady bhlady@qnx.com
OEM Support Rep QSSL
+===================================+
“Igor Levko” <i_levko@hotmail.com> wrote in message
news:9vntbr$4rl$1@inn.qnx.com

I’ve freshly installed QNX6.1 + patchA development stuff.
And to my amezement this simplest piece of code cannot be compiled.

#include <stdlib.h

int main(void)
{
return 0;
}

gcc -o xtest xtest.cpp
/usr/include/stdlib.h 239: ‘abort’ is already included
/usr/include/stdlib.h 239: ‘abs’ is already included
/usr/include/stdlib.h 239: ‘exit’ is already included
/usr/include/stdlib.h 239: ‘labs’ is already included

What is that? Is it a new feature?

Well, I found that if I either defined __GCC_BUILTIN or used <cstdlib
I could get rid of this error. I don’t reckon that it makes sence to
replace
stdlib.h with cstdlib in all src files, so that defining __GCC_BUILTIN
seems
to be ok but I did not find any info about this define.
If anyone can point to it I’d appreciate.

cheers,
Igor