After installing QNX 6.1.0 and Dinkum libraries, reference to the string
C++ class seems not to
exist. I searched for the definition of string, and found it in a file
called ‘xstring’.
I thought the definition should be in ‘string’ and that I should include
‘string’ to be able to
declare instances of string, or what?? Where is actually ‘string’
defined??
In the old libraries I also defined a new class called
typedef basic_string Ustring;
by putting this in the string class-file (which seemed very simple in
those libraries).
The Dinkum string class-file seems more complex… Where can I put my
Ustring definition now??
Regards
-Arve
You must have a ‘using namespace std’ to use the Dinkum C++ headers.
Arve Slenes <arve@datarespons.no> wrote:
After installing QNX 6.1.0 and Dinkum libraries, reference to the string
C++ class seems not to
exist. I searched for the definition of string, and found it in a file
called ‘xstring’.
I thought the definition should be in ‘string’ and that I should include
‘string’ to be able to
declare instances of string, or what?? Where is actually ‘string’
defined??
In the old libraries I also defined a new class called
typedef basic_string Ustring;
by putting this in the string class-file (which seemed very simple in
those libraries).
The Dinkum string class-file seems more complex… Where can I put my
Ustring definition now??
Regards
-Arve
–
cburgess@qnx.com
Hi…
Pardon my ignorance, but…
…where do we put this ‘using namespace std’ ?? Any where? In one
place only? Any time I make a call to the functions that use these
libraries??
I wonder, where is the information needed to know that this is what
needs to be done?
What other namespaces are needed to do different things? Where is a
list of them, and where do we find how to use the namespaces?
I guess that my programing style is old. 
Thanks for your help.
Bests…
Miguel.
Colin Burgess wrote:
You must have a ‘using namespace std’ to use the Dinkum C++ headers.
Arve Slenes <> arve@datarespons.no> > wrote:
After installing QNX 6.1.0 and Dinkum libraries, reference to the string
C++ class seems not to
exist. I searched for the definition of string, and found it in a file
called ‘xstring’.
I thought the definition should be in ‘string’ and that I should include
‘string’ to be able to
declare instances of string, or what?? Where is actually ‘string’
defined??
In the old libraries I also defined a new class called
typedef basic_string Ustring;
by putting this in the string class-file (which seemed very simple in
those libraries).
The Dinkum string class-file seems more complex… Where can I put my
Ustring definition now??
Regards
-Arve
–
cburgess@qnx.com
–
my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.
Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com
I figured it out just after I posted the message. Thanks anyway…
Guess I could define my Ustring in xstring… It worked anyway…
-Arve
Colin Burgess wrote:
You must have a ‘using namespace std’ to use the Dinkum C++ headers.
Arve Slenes <> arve@datarespons.no> > wrote:
After installing QNX 6.1.0 and Dinkum libraries, reference to the string
C++ class seems not to
exist. I searched for the definition of string, and found it in a file
called ‘xstring’.
I thought the definition should be in ‘string’ and that I should include
‘string’ to be able to
declare instances of string, or what?? Where is actually ‘string’
defined??
In the old libraries I also defined a new class called
typedef basic_string Ustring;
by putting this in the string class-file (which seemed very simple in
those libraries).
The Dinkum string class-file seems more complex… Where can I put my
Ustring definition now??
Regards
-Arve
–
cburgess@qnx.com
After you include your headers, put:
using namespace std;
This will bring all of the std classes, etc. into your scope. I believe that
you could also reference everything prefixed with std:: but that would be a
bit of a pain. Note that this is the correct behaviour for includes as
defined in the C++ specification. It is just that many of the older headers
aren’t as strict about setting namespaces on standard headers. You should
take a look at using namespaces - they’re actually a very nice and powerful
feature.
cheers,
Kris
Miguel Simon <simon@ou.edu> wrote:
Hi…
Pardon my ignorance, but…
…where do we put this ‘using namespace std’ ?? Any where? In one
place only? Any time I make a call to the functions that use these
libraries??
I wonder, where is the information needed to know that this is what
needs to be done?
What other namespaces are needed to do different things? Where is a
list of them, and where do we find how to use the namespaces?
I guess that my programing style is old. 
Thanks for your help.
Bests…
Miguel.
Colin Burgess wrote:
You must have a ‘using namespace std’ to use the Dinkum C++ headers.
Arve Slenes <> arve@datarespons.no> > wrote:
After installing QNX 6.1.0 and Dinkum libraries, reference to the string
C++ class seems not to
exist. I searched for the definition of string, and found it in a file
called ‘xstring’.
I thought the definition should be in ‘string’ and that I should include
‘string’ to be able to
declare instances of string, or what?? Where is actually ‘string’
defined??
In the old libraries I also defined a new class called
typedef basic_string Ustring;
by putting this in the string class-file (which seemed very simple in
those libraries).
The Dinkum string class-file seems more complex… Where can I put my
Ustring definition now??
Regards
-Arve
–
cburgess@qnx.com
–
my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.
Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com
–
Kris Warkentin
kewarken@qnx.com
(613)591-0836 x9368
“You’re bound to be unhappy if you optimize everything” - Donald Knuth
Hi Kris…
Kris Eric Warkentin wrote:
After you include your headers, put:
using namespace std;
This will bring all of the std classes, etc. into your scope. I believe that
you could also reference everything prefixed with std:: but that would be a
bit of a pain. Note that this is the correct behaviour for includes as
Ok. Now I know.
defined in the C++ specification. It is just that many of the older headers
aren’t as strict about setting namespaces on standard headers. You should
take a look at using namespaces - they’re actually a very nice and powerful
feature.
I’ll do so. Thanks for the help.
Miguel.
cheers,
Kris
–
my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.
Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com
Try reading about namespaces in Bjarne Stroustrup’s book “The C++ Programming
Language”.
ISBN 0-201-88954-4
He created C++, so his book should be a good source …
-Arve
Miguel Simon wrote:
Hi…
Pardon my ignorance, but…
…where do we put this ‘using namespace std’ ?? Any where? In one
place only? Any time I make a call to the functions that use these
libraries??
I wonder, where is the information needed to know that this is what
needs to be done?
What other namespaces are needed to do different things? Where is a
list of them, and where do we find how to use the namespaces?
I guess that my programing style is old. 
Thanks for your help.
Bests…
Miguel.
Colin Burgess wrote:
You must have a ‘using namespace std’ to use the Dinkum C++ headers.
Arve Slenes <> arve@datarespons.no> > wrote:
After installing QNX 6.1.0 and Dinkum libraries, reference to the string
C++ class seems not to
exist. I searched for the definition of string, and found it in a file
called ‘xstring’.
I thought the definition should be in ‘string’ and that I should include
‘string’ to be able to
declare instances of string, or what?? Where is actually ‘string’
defined??
In the old libraries I also defined a new class called
typedef basic_string Ustring;
by putting this in the string class-file (which seemed very simple in
those libraries).
The Dinkum string class-file seems more complex… Where can I put my
Ustring definition now??
Regards
-Arve
–
cburgess@qnx.com
–
my opinions are mine, only mine, solely mine, and they are not related
in any possible way to the institution(s) in which I study and work.
Miguel Simon
Research Engineer
School of Aerospace and Mechanical Engineering
University of Oklahoma
http://www.amerobotics.ou.edu/
http://www.saic.com