Apparent C++ problems

Dave Bennett dbennett2 at ntlworld.com
Fri Dec 28 13:43:57 PST 2001


In article <f6800bf04a.peter at moo.chocky.org>,
   Peter Naulls <peter at chocky.org> wrote:
> In message <4af0099478dbennett2 at ntlworld.com>
>           Dave Bennett <dbennett2 at ntlworld.com> wrote:

> [ Please try and use a subject in future]

(Sorry, believe it or not, that's the first time I've ever forgotten to do
that.  In fact I'm surprised Pluto didn't remind me...)

> > I have already hit a couple of problems with the new 2_95_4 C++
> > compiler.
> > 
> > When I compile the printf version of the "Hello, world" program using
> > the default option of unixlib, all is well.  However if I try to
> > compile using the -mlibscl option, I get a number of lines in stdio.h
> > flagged because "__gnuc_va_list" is not being defined.

> You must be doing something odd:

> *gcc -mlibscl hellow.c -v

But this is using the C compiler rather than the C++ compiler.  I haven't
even bothered downloading the C compiler because I didn't think I needed
it.  (Does the C++ compiler require the C compiler to be present?)  I just
copied "hellow" to a "cc" directory and compiled as follows:

*gcc -mlibscl hellow.cc -v
Using builtin specs.
gcc version 2.95.4 20010319 (prerelease) [gccsdk 20010912]
 gccpkg:bin/arm-riscos-aof/2_95_4/cpp -lang-c++ -v -D__GNUC__=2
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Darm -Driscos -D__arm__
-D__riscos__ -D__arm -D__riscos -Asystem(riscos) -Acpu(arm)
-Amachine(acorn) -D__EXCEPTIONS -D__CHAR_UNSIGNED__ -D__ARM_ARCH_2__
-D__APCS_26__ -D__JMP_BUF_SIZE=24 -D__TARGET_SCL__ -icrossdirafter /libscl
hellow.cc /tmp/cccLkugb.ii
gccpkg:bin.arm-riscos-aof.2_95_4.cpp: GNU CPP version 2.95.4 20010319
(prerelease) [gccsdk 20010912] (ARM/RISC OS with AOF)
gccpkg:bin.arm-riscos-aof.2_95_4.cpp: ignoring nonexistent directory
`gccpkg:local/include'
gccpkg:bin.arm-riscos-aof.2_95_4.cpp: ignoring nonexistent directory
`gccpkg:sys/include'
#include "..." search starts here:
#include <...> search starts here:
 gccpkg:lib/gcc-lib/arm-riscos-aof/2_95_4/include/g++-3
 gccpkg:lib/gcc-lib/arm-riscos-aof/2_95_4/include
 gccpkg:include/libscl
End of search list.
 gccpkg:bin/arm-riscos-aof/2_95_4/cc1plus /tmp/cccLkugb.ii -quiet
-dumpbase hellow.cc -mlibscl -version -o /tmp/ccgmvOmc.s
GNU C++ version 2.95.4 20010319 (prerelease) [gccsdk 20010912]
(arm-riscos-aof) compiled by GNU C version 2.95.4 20010319 (prerelease)
[gccsdk 20010912].
In file included from hellow.cc:5:
gccpkg:include/libscl/stdio.h:207: type specifier omitted for parameter
gccpkg:include/libscl/stdio.h:207: parse error before `)'
gccpkg:include/libscl/stdio.h:208: type specifier omitted for parameter
gccpkg:include/libscl/stdio.h:208: parse error before `*'
gccpkg:include/libscl/stdio.h:218: type specifier omitted for parameter
gccpkg:include/libscl/stdio.h:218: parse error before `)'
gccpkg:include/libscl/stdio.h:221: type specifier omitted for parameter
gccpkg:include/libscl/stdio.h:221: parse error before `*'
gccpkg:include/libscl/stdio.h:232: type specifier omitted for parameter
gccpkg:include/libscl/stdio.h:232: parse error before `)'
gccpkg:include/libscl/stdio.h:235: type specifier omitted for parameter
gccpkg:include/libscl/stdio.h:235: parse error before `*'


> > Secondly, when I try to compile the iostream version of the "Hello,
> > world" program (using the default option of unixlib), the link editor
> > fails to resolve the "cout" and "<<" references.  I've tried adding
> > the -liostream option which I used to use with 2_95_1, but this just
> > gives a "libiostream not found" error.  Am I missing a library file or
> > do I just need to specify a different parameter?

> You must be doing something strange here too:

> *gcc helloworld.cc -liostream -v

When I try it, I get:

Using builtin specs.
gcc version 2.95.4 20010319 (prerelease) [gccsdk 20010912]
 gccpkg:bin/arm-riscos-aof/2_95_4/cpp -lang-c++ -v -D__GNUC__=2
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D
__cplusplus -Darm -Driscos -D__arm__ -D__riscos__ -D__arm -D__riscos
-Asystem(riscos) -Acpu(arm) -Amachine(acorn) -D__EXCEPTIONS
-D__CHAR_UNSIGNED__ -D__ARM_ARCH_2__ -D__APCS_26_ -D__JMP_BUF_SIZE=24
-icrossdirafter /unixlib helloworld.cc /tmp/cc9a5ugb.ii
gccpkg:bin.arm-riscos-aof.2_95_4.cpp: GNU CPP version 2.95.4 20010319
(prerelease) [gccsdk 20010912] (ARM/RISC OS with AOF)
gccpkg:bin.arm-riscos-aof.2_95_4.cpp: ignoring nonexistent directory
`gccpkg:local/include'
gccpkg:bin.arm-riscos-aof.2_95_4.cpp: ignoring nonexistent directory
`gccpkg:sys/include'
#include "..." search starts here:
#include <...> search starts here:
 gccpkg:lib/gcc-lib/arm-riscos-aof/2_95_4/include/g++-3
 gccpkg:lib/gcc-lib/arm-riscos-aof/2_95_4/include
 gccpkg:include/unixlib
End of search list.
 gccpkg:bin/arm-riscos-aof/2_95_4/cc1plus /tmp/cc9a5ugb.ii -quiet
-dumpbase helloworld.cc -version -o /tmp/ccac0Pmc.s
GNU C++ version 2.95.4 20010319 (prerelease) [gccsdk 20010912]
(arm-riscos-aof) compiled by GNU C version 2.95.4 20010319 (prerelease)
[gccsdk 20010912].
 gccpkg:bin/arm-riscos-aof/2_95_4/as -o /tmp/ccndVatd.o /tmp/ccac0Pmc.s
 gccpkg:bin/arm-riscos-aof/2_95_4/ld
-Lgccpkg:bin/arm-riscos-aof/2_95_4/apcs26/unixlib
-Lgccpkg:bin/arm-riscos-aof/2_95_4 /tmp/ccndVatd.o -liostream -lgcc
-lunixlib -lgcc
ld fatal error: library file libiostream not found
gcc: Fatal compiler error: program ld


In which of the downloads should I have found libiostream?  (Surely not
with the C compiler?)

-- 
Dave Bennett



More information about the gcc mailing list