Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / General Programming / Visual Studio 2003 problem... Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

April 09, 2005, 07:53 AM

I've updated my programming ambient to VisualStudio 2003 by a few day, but a first !BIG! problem comes in front of me...

While VisualStudio 6.0 with service pack (I not remind what version...) can easily handle sucessive code, the new version of Microsoft compiler generates a pletora of errors with typedefs. Can someone of You help me understanding WHY!?

class iResourceManager
typedef std::map< iString, iReference > iResourceMap;
typedef std::map< iString, iReference >::iterator iResourceMapIter;
typedef std::map< iString, iReference >::const_iterator iResourceMapConstIter;
typedef std::map< iString, iReference >::value_type iResourceMapPair;


Thanks a lot for any helps!
...and sorry for my bad english skills...

Thomas Young

April 09, 2005, 08:26 AM

Posting the errors would help, but you can try the following:

  2. template <class T>
  3. class iResourceManager
  4. {
  5. protected:
  6. typedef std::map< iString, iReference<T> > iResourceMap;
  7. typedef typename std::map< iString, iReference<T> >::iterator iResourceMapIter;
  8. typedef typename std::map< iString, iReference<T> >::const_iterator iResourceMapConstIter;
  9. typedef typename std::map< iString, iReference<T> >::value_type iResourceMapPair;


April 09, 2005, 08:37 AM

Sorry but I'm not on my computer now...ehehe, but I'll try soon as possible! Thank you!


April 10, 2005, 01:28 AM

VS 2003 is way stricter (as is 2002) with templates, also a lot closer to the standard than VS6 ever was. You may need to declare the type of the template parameter:

  2. template <class T>class iResourceManager
  3. {
  4.   protected:
  5.     typedef std::map< iString, iReference<class T> > iResourceMap;
  6.     typedef std::map< iString, iReference<class T> >::iterator iResourceMapIter;
  7.     typedef std::map< iString, iReference<class T> >::const_iterator iResourceMapConstIter;
  8.     typedef std::map< iString, iReference<class T> >::value_type iResourceMapPair;
  9. }

Note the class before using T in the template definition.


April 10, 2005, 04:38 AM

First, thanks for your helps!
adding typename to definitions seems to be usefull, as the code is compiled in the right manner.

Now a new problem pops up...

This is a constructor of my sse matrix class: inline iMatrixSSE(__m128 r0, __m128 r1, __m128 r2, __m128 r3);

compiling it VisualStudio gives me this error message: error C2719: "r3": il parametro formale con __declspec(align("16")) non verrą allineato
in inglish something like: "r3": the formal parameter with __declspec(align("16")) will not be aligned

As before, the same code with VisualStudio 6.0 works it don't...


April 10, 2005, 06:31 AM

I think the problem is that you try to pass these parameters by-value on the stack, which means it cannot guarantee alignment? (non-aligned data will cause an exception with most SSE operations).
So I guess you should pass them by-reference instead, it should align the variables properly when you define them.

This thread contains 6 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.