STL stack w/ primitive data types

I have the following test program:
#include
#include <stl.h>
#include
#include
#include

int main()
{
list test;
vector foo;
stack bar;
}

when I try to compile it, I get:
[steve@localhost steve]$ QCC a.cc
a.cc: In instantiation of Stack<int>': a.cc:11: instantiated from here a.cc:11: int’ is not a class, struct, or union type
a.cc:11: template argument 1 is invalid
cc: /usr/lib/gcc-lib/ntox86/2.95.3/cc1plus error 33

So I can declare lists and vectors of primitive data
types like ‘int’, but for some reason it doesn’t like
me doing it with stacks. Does anyone know why this is?
It seems like strange behaviour to me.

cheers,
steve

This seems to be related to the dinkum headers. If you compile with
something like:

QCC -Vgcc_ntox86 -Y_gpp

where the -Y_gpp tells qcc to use the gnu c++, it works. We’ll take a look
at it here internally. Thank you very much for the bug report.

cheers,

Kris

“Stephen Lau” <slau@qm.com> wrote in message
news:arjbas$q7o$1@inn.qnx.com

I have the following test program:
#include <iostream
#include <stl.h
#include <stack
#include <vector
#include <list

int main()
{
list test;
vector foo;
stack bar;
}

when I try to compile it, I get:
[steve@localhost steve]$ QCC a.cc
a.cc: In instantiation of Stack<int>': a.cc:11: instantiated from here a.cc:11: int’ is not a class, struct, or union type
a.cc:11: template argument 1 is invalid
cc: /usr/lib/gcc-lib/ntox86/2.95.3/cc1plus error 33

So I can declare lists and vectors of primitive data
types like ‘int’, but for some reason it doesn’t like
me doing it with stacks. Does anyone know why this is?
It seems like strange behaviour to me.

cheers,
steve

Hi Kris,
This fixed my problem! Thanks much for the quick response.

cheers,
steve

Kris Warkentin wrote:

This seems to be related to the dinkum headers. If you compile with
something like:

QCC -Vgcc_ntox86 -Y_gpp

where the -Y_gpp tells qcc to use the gnu c++, it works. We’ll take a
look
at it here internally. Thank you very much for the bug report.

cheers,

Kris

“Stephen Lau” <> slau@qm.com> > wrote in message
news:arjbas$q7o$> 1@inn.qnx.com> …
I have the following test program:
#include <iostream
#include <stl.h
#include <stack
#include <vector
#include <list

int main()
{
list test;
vector foo;
stack bar;
}

when I try to compile it, I get:
[steve@localhost steve]$ QCC a.cc
a.cc: In instantiation of Stack<int>': a.cc:11: instantiated from here a.cc:11: int’ is not a class, struct, or union type
a.cc:11: template argument 1 is invalid
cc: /usr/lib/gcc-lib/ntox86/2.95.3/cc1plus error 33

So I can declare lists and vectors of primitive data
types like ‘int’, but for some reason it doesn’t like
me doing it with stacks. Does anyone know why this is?
It seems like strange behaviour to me.

cheers,
steve

“Stephen Lau” <slau@qm.com> wrote in message
news:arjft0$20u$1@inn.qnx.com

Hi Kris,
This fixed my problem! Thanks much for the quick response.

Well, it didn’t FIX your problem. I only masked it by showing you how to
use a different set of C++ libs and headers. If nothing else, however, it
will keep you working until we get a fix up and you can go back to Dinkum.
(or you can stick with GNU…whatever floats your boat :wink:

cheers,

Kris