STL stack w/ primitive datatypes

bridged with qdn.public.qnxrtp.devtools
Post Reply
Stephen Lau

STL stack w/ primitive datatypes

Post by Stephen Lau » Thu Dec 05, 2002 7:47 pm

Hi, I'm hoping someone from QNX can help me out here. :)
I posted on qdn.public.devtools a short while ago (2 weeks roughly), and
Kris Warkentin helped me out (as you can see below). Anyway, my question
is regarding this bug with the dinkum headers. Has this been fixed at all?

We would like to use the Dinkum libraries instead of the GNU libraries for
legal reasons, but we are having the same problem (as well as few other STL
related problems such as passing vectors as arguments to functions) that
only seem to manifest themselves when compiling with the Dinkum libraries.
Compiling with the two flags Kris mentioned below so that the GNU libraries
are used instead resolves these problems.

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<int> test;
vector<int> foo;
stack<int> 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

Post Reply

Return to “qdn.public.qnxrtp.devtools”