Thanks Colin
It is a little better now - still some problems.
The ‘invalid preprocessing directive’ was a typo in the quick hello-world
code I typed up when things were already bad, so I didn’t check it as
thoroughly as I should have (it actually said #!include <stdlib.h>).
Still, I’m having trouble further down the compile (this same code definitely
works on both QNX 4.25 and Linux)
/usr/include/string.h: In function void * std::memchr(void *, int, unsigned int)': /usr/include/string.h:125: declaration of C function
void * std::memchr(void
*, int, unsigned int)’ conflicts with
/usr/include/string.h:49: previous declaration `const void *
std::memchr(const void *, int, unsigned int)’ here
and so on for strchr, strpbrk, strstr, (though they say ‘passing …’,
‘discards qualifiers’)
cheers
Lance
Colin Burgess wrote:
Hi Lance,
Lance Roberts <> lance@econz.co.nz> > wrote:
Hi Guys,
I have a weird problem using g++ - only since upgrading to 6.1
Initially I had lost ‘cvs’, so I did a full install of all new stuff on
the CD (e.g X server, PhAster, etc - I did a ‘full’ install to get
upgraded, but it seemed to have left a lot of it out).
Now, I get messages such as :
In file included from test.cpp:32:
/usr/include/string.h:155: ‘memcmp’ is already declared in this scope
/usr/include/string.h:155: ‘memcpy’ is already declared in this scope
/usr/include/string.h:156: ‘strcmp’ is already declared in this scope
/usr/include/string.h:156: ‘strcpy’ is already declared in this scope
/usr/include/string.h:156: ‘strlen’ is already declared in this scope
It would appear that there was a bug in the specs file.
Edit /usr/lib/gcc-lib/ntox86/2.95.2/specs
find
*cc1plus:
-fhonor-std
and change it to
*cc1plus:
%(cc1plus_spec) -fhonor-std -fno-builtin
but it seems like a larger problem is with ‘cc’
e.g. ‘cc f.c’ gives me ‘invalid pre-processing directive name’
and '/usr/lib/gcc-lib/ntox86/2.95.2/cpp error 33
:1: invalid #-line
(my top line of f.c is #include <stdlib.h>)
Is this par for the course, or has my installation botched somewhere?
It doesn’t do that for me. Take a look at the preprocessed output (ie
cc -P f.c, then look at f.i)
–
cburgess@qnx.com