The problem with min/max is that they are both defined in STL and in the Palm
headers (see UICommon.h).  So you'll probably need to do something like remove
them from UICommon.h, or undef them after including UICommon.h (as in the
workaround you posted).

I'm not sure what other problems you're having with <vector> and/or <iterator>,
so I can't help you there.

-- Keith






David Korus <[EMAIL PROTECTED]> on 09/30/99 06:01:55 PM

Please respond to [EMAIL PROTECTED]

Sent by:  David Korus <[EMAIL PROTECTED]>


To:   "'palm-dev-forum @3com.com'" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/HQ/3Com)
Subject:  RE: Problems Using STL Vectors




To reproduce the vector error I have been getting, I've been using the
following code:


include <Pilot.h>
#include <SysEvtMgr.h>
#include "Cycles_res.h"  // includes any resources from the .rsrc file
#include <vector>
using namespace std;

// After this the rest is the same as the Starter C++ stationary project
// all code that I know works and uses no vectors


The compile error comes on line 37 of algobase.h.  The error is:

Error ')' expected
algobase.h line 37   (((const T& a) < (const T& b)) ? (const T& a): (const
T& b))

with the related code in algobase.h being:

template <class T>
inline const T& min (const T& a, const T& b)
{ return b < a ? b : a; }



It seems it isn't handling the inlining of the parameter types correctly.
I'm not exactly sure what the problem is, but this is the first in a long
line of error messages.  Someone sent a workaround that goes like this:

#undef min     // conflict with MSL
#undef max     // conflict with MSL
#pragma warn_implicitconv off // turn off warnings in MSL
#pragma warn_notinlined off        // turn off warnings in MSL

#include <vector>


This seems to take care of the compile errors, but I get some misc. errors
in <iterator> if I try to do anything complex.  I could put an example of
this up, but I'm not really sure exactly what part of the code I'm porting
is the problem.  I'll find out and post that problem later.

As for the problem compiling the <vector> header, it does seem to be a
problem with the actual library/header routines.  I can't even compile it
with a simple program that doesn't use vectors and does just about nothing.


David Korus


-----Original Message-----
From: Jun-Kiat Lam [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 30, 1999 3:16 PM
To: [EMAIL PROTECTED]
Subject: Re: Problems Using STL Vectors


Hi David,

What is the exact error you are seeing? A code snippet would be helpful as
well.

Jun-Kiat Lam
Metrowerks Technical Support

----- Original Message -----
From: David Korus <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 30, 1999 2:34 PM
Subject: Problems Using STL Vectors


> Hi All,
> Perhaps someone can help me.  I'm having trouble getting a program
> to work using the MSL library functions.  I'm essentially just trying to
get
> any program working to use STL vectors by using the <vector> include file.
> Anyway, I'm getting all sorts of errors compiling and I was wondering if
> anyone knew what I was doing wrong, or even better, could just send me an
> example project that uses vectors.
> I suspect I have some compilation option wrong, but I can't seem to
> find any that effect my compilation.
>
> Anyway, my program is essentially the "starter" application with <vector>
> included.  Thanks!
>
>
> David Korus
>







Reply via email to