Symbian + STL Port
Login to reply to this topic.
Mon, 2003-09-01 15:53
Joined: 2003-09-01
Forum posts: 7
Hi,

I need use the STL library in Symbian. I found a implementation of this library in: 3GLab.org but this version only works in the emulator.

The problem is the header _alloc.h have static menbers and when compile this version to the ARM the PETRAN show and error because the library have global/static variables. In the emulator this is not a problem and the aplication works well.

Any idea?
Anybody knows about it?

(I try with the -allowdlldata with the PETRAN but this have horrible results, compile but after don´t work.

Someboy use the STL in Symbian proyect?

Thanks in advanced.
Sir Graham.


Fri, 2003-10-24 21:11
Joined: 2003-10-24
Forum posts: 2
Hola Sir Graham,

I've the same problem.
Did you find any STL implementation can be used on Symbian devices?

Best regards,
Reiner
Sat, 2003-10-25 16:40
Joined: 2003-05-27
Forum posts: 363
Hello,

I think it goes like this: STL needs exceptions, Symbian has no standard C++ exceptions -> hence no STL on Symbian. There is not much you can do about this if you need full standards conformance.

Cheers,
Pawel
Sat, 2003-10-25 20:15
Joined: 2003-10-24
Forum posts: 2
Hola Pawel,

I was developing software for the WinCE/PocketPC platform. On this platform excecptions are not available, but I found an STL implementation running without exceptions very well. So I thing is't possible to use exception free STL implementations on the Symbian platform too.

Do you know any implementations for vector and list container objects realized as C++ classes? I only need the this container classes for my project.

Best regards,
Reiner

Quote from: pawel
Hello,

I think it goes like this: STL needs exceptions, Symbian has no standard C++ exceptions -> hence no STL on Symbian. There is not much you can do about this if you need full standards conformance.

Cheers,
Pawel
Sat, 2003-10-25 22:01
Joined: 2003-05-27
Forum posts: 363
Hi Rainer!

Are you looking for exact replicas of STL vectors/lists based on templates, or would any reasonable dynamic array/list class do for you? Symbian has the latter ones already built-in.

Cheers,
Pawel
Wed, 2003-11-05 09:28
Joined: 2003-11-04
Forum posts: 3
hi!

I got the same problem as Reiner. What i need is a wrapper-template for the symbian-arrays so that I can use "vector" instate. I don't need a whole symbian STLport - just the vector-template.

I alreay try to do it myself, but I didn't get it. (RArrays don't support At(); and FixFlat-Arrays I don't know how to set the keys, to search in the arrays)

well - thats the problem. has anybody got a solution?

geri-m
Wed, 2003-11-05 11:03
Joined: 2003-05-27
Forum posts: 363
Hello,

So what is the problem actually? You can just write your own vector template like this:

Code:
template <class T>
class vector
   {
public:
/// Write the methods that you need

private:
  CArrayFixFlat<T>* iArray;
   }

Cheers,
Pawel
Thu, 2003-11-06 11:09
Joined: 2003-11-04
Forum posts: 3
hi,

at first i tried a RArray. But I was not able to get specific Element with its index using eg At() (is there another methode for this?). Next thing is that elements must be less than 640 bytes size. Due to the fact, I wanted to use the vector for any object, I would not be happy with this solution.

Then I tried the FixFlat-Array. Here I got the Problem, that I'm not able to create a key for searching, (I think I have to - or not?) because I need to know the typ of objects I want to place in the array.

Please tell me, if my thoughts are garbage, cause I'm new to C++ & Symbain.

Cheers,

geri-m
Thu, 2003-11-06 15:47
Joined: 2003-05-27
Forum posts: 363
Hi,

First of all, the RArray class has the operator [] defined... Secondly, if you have huge elements, you should store pointer to elements (4 bytes) in the array.

Cheers,
Pawel
Fri, 2003-11-07 12:01
Anonymous (not verified)
Forum posts: 2037
The Symbian API doesn't use Exceptions.

However, exceptions are a c++ compiler thing; and exceptions work just fine.

In your app's MMP or PREF (if you're a CodeWarrior) file, try using the ALLOWSTATICDATA (check my spelling etc) directive.

Another approach might be to build it into an exe; they are allowed writeable static too.

Best of luck!
Fri, 2003-11-07 13:57
Joined: 2003-11-04
Forum posts: 3
hi,

i was not able to use the "ALLOWSTATICDATA" directive. it is also not listed in the symbian build reference (http://www.symbian.com/developer/techlib/v70docs/SDL_v7.0/doc_source/ToolsAndUtilities/Build-ref/Mmp-ref/). but it would be really usefull.

another question: what is the difference between "app" und "exe"? (was not able to find something suitable with google). i was not able to build an application as "exe" just by modifying the mmp file. what else is there to do? .... ähm yes - could somebody recommend me a good book on symbian. i think this would help Wink

@pawel: thanks for the hint with the []-operator ... i think will now use RArrays.

cheers,

geri-m
Fri, 2003-11-07 15:57
Joined: 2003-01-14
Forum posts: 2133
For APP/EXE, there is a short introduction there : http://www.newlc.com/article.php3?id_article=143

However this will not teach you how to write an EXE. Check the examples in the EpocEx directories. There are a lot of them.

Regarding books, a good one would probably be Symbian OS C++ for Mobile Phones.

Cheers,
Eric

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Tue, 2003-12-16 13:23
Joined: 2003-12-16
Forum posts: 3
Oh, that's right. You don't need libraries since you could always write every class you need yourself. Is that your point?

I need a lot of other datastructures than just simple arrays and linked lists and I really think that symbian should include for instance sets and maps in their libraries. Don't you?

Quote from: pawel
Hello,

So what is the problem actually? You can just write your own vector template like this:

Code:
template <class T>
class vector
   {
public:
/// Write the methods that you need

private:
  CArrayFixFlat<T>* iArray;
   }

Cheers,
Pawel
Tue, 2003-12-16 17:46
Joined: 2003-05-27
Forum posts: 363
No offense, but my reponse was to the question set by chevy and geri-m who needed the vector and list containers. If you need the STL functionality and containers, you are currently out of luck with the Symbian platform.

-Pawel
Fri, 2006-11-17 11:02
Joined: 2006-04-18
Forum posts: 13
Quote
Hello,

I think it goes like this: STL needs exceptions, Symbian has no standard C++ exceptions -> hence no STL on Symbian. There is not much you can do about this if you need full standards conformance.

Cheers,
Pawel

Hi.
I think that it does not go like this. Look how exceptions are used in STL:
 #if _HAS_EXCEPTIONS
 #define _TRY_BEGIN   try {
 #define _CATCH(x)   } catch (x) {
 #define _CATCH_ALL   } catch (...) {
 #define _CATCH_END   }

 #define _RAISE(x)   throw (x)
 #define _RERAISE   throw

 #define _THROW0()   throw ()
 #define _THROW1(x)   throw (...)
 #define _THROW(x, y)   throw x(y)

 #else /* _HAS_EXCEPTIONS */
 #define _TRY_BEGIN   {{
 #define _CATCH(x)   } if (0) {
 #define _CATCH_ALL   } if (0) {
 #define _CATCH_END   }}

vector(const _Myt& _Right)
      : _Mybase(_Right._Alval)
      {   // construct by copying _Right
      if (_Buy(_Right.size()))
         _TRY_BEGIN
         _Mylast = _Ucopy(_Right.begin(), _Right.end(), _Myfirst);
         _CATCH_ALL
         _Tidy();
         _RERAISE;
         _CATCH_END
      }

I think that c++ exception handling is not problem in porting STL!
Fri, 2006-11-17 11:07
Joined: 2003-01-14
Forum posts: 2133
Quote
I think that c++ exception handling is not problem in porting STL!

It was in 2003 as exception support has only been introduced in Symbian OS 9.

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant


copyright 2003-2009 NewLC SARL