PDA

View Full Version : armcpp + std::string


starscream
05-21-2003, 01:30 PM
Hello,

Just started using C++ for brew dev and am getting the following from armcpp:

class-name 'std' not found

I added "using namespace std" to the code but then armcpp stated that this directive is not fully supported. Is there some other way to use std containters (namely string and vector)? (or is "using" supported enough?) Thanks!

- Richard.

PS: For anyone using C++, how positive has the experience been? Should I stick to C? Thanks!

tyndal
05-21-2003, 08:27 PM
I think you aren't supposed to use stuff from the standard libraries with brew.

There are a couple of articles on Developer.com about using C++ with brew, and writing your own String/Vector classes.

http://www.developer.com/ws/brew/

I haven't done any development in C++ myself yet, just forwarding some information Ive seen other places.

-Tyndal

Murray Bonner
05-22-2003, 09:58 AM
Namespaces aren't supported by the ARM C++ compiler because they are not part of the Embedded C++ "standard".

In spite of the limitations imposed, my experience with using C++ with BREW has been positive. You can still use inheritance and polymorphism in your own classes. Just don't try to derive your own classes from the BREW interfaces because they are not C++ classes.

For more detail, see the articles suggested by Tyndal.

MB

PS: I tried to use STL with BREW and met with no success. That said, I didn't dig into the issue in depth. After seeing Radu Braniste write his own string and vector classes, I assumed that the C++ standard library was inaccessible from BREW. Perhaps Radu can comment?

aisaksen
05-24-2003, 02:15 AM
I have gotten the STL to work with the ARM C++ compiler on a non-BREW project, so I know that it is capable of compiling and executing STL code. I recall that you had to be more explicit when defining the template instantiator parameters than with Visual C++ because templates are not fully supported. I wonder if the problems you faced in getting it to work with BREW were because 1) the STL requires static/global memory or 2) all the rarer memory operators were not correctly overloaded in your system.

radub
05-26-2003, 10:25 AM
Hi All
MHO:
1. There is definitely a STL port for ARM that was used for BREW development (as far as I know Reaxion has a parser based on it, and some people tried successfully to use it in test projects, see
http://qisbbsprd.qualcomm.com/showthread.php?s=&threadid=808&highlight=STL%2A
2. This doesn't mean automatically that STL is usable in its entirety or is efficient on BREW - see the std::string considerations of Scott Mayer, the fact that there might be statics, stack usage, templatized policies that come as an unwanted bonus, etc. All these "might-be"s have to be tested
3. The template support in ADS 1.x is definitely better than on VC6 but still far from standard. 2.0 ARM compiler solves many of the issues (see http://qisbbsprd.qualcomm.com/showthread.php?s=&threadid=1125). On top of this, as Murray said, there is no namespace & exceptions support and allocators have to be BREW specific.

HTH
Radu