Re: error in compiling 2002 code in 2005

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On May 1, 11:48 am, Norbert Unterberg <nunterb...@xxxxxxxxxxxxxxxxx>
wrote:
p2 schrieb:

On Apr 24, 3:20 pm, David Wilkinson <no-re...@xxxxxxxxxxxx> wrote:
p2 wrote:
Hi
i have code build in visual studio 2002 .
when i open that code in 2005 it pops up conversion wizard..
it convert successfully .
but when i build it gives error
is something is missing ?
it gives error in "Iterator" keyword?
Errors ::
warning C4346: 'Iterator::difference_type' : dependent name is not a
type
prefix with 'typename' to indicate a type
see reference to class template instantiation
'iterator_traits<Iterator>' being compiled

[...]

the code is as follows :: //following is the code for above errors

template< class Iterator >
struct iterator_traits
{
typedef Iterator::difference_type difference_type;
typedef Iterator::value_type value_type;
typedef Iterator::pointer pointer;
typedef Iterator::reference reference;
typedef Iterator::iterator_category iterator_category;
};

The error message is correct, what you post here is invalid C++. The error
message tells you already the solution, you need to add the typename keyword:

> typedef typename Iterator::difference_type difference_type;

But I assume your problem is something totally different.

The code you post is usually part of the C++ standard library. This library is
part of visual studio 2005. If you just take a new VS2005 project than these
errors should not happen.

So I guess you have more than one standard library installed on your computer,
and you have messed up the visual studio include paths. But that is hard to tell
because you still did not give us the full error message (including file name
and line number!).

Do you use a different C++ standard library? Have you added some other
compiler's include paths to your project settings? Do you use the stdandard
library or the stl? DO you include <vector> or <vector.h>?

Norbert

I had installed :: as sequence
->Visual studio 6
->platform sdk for windows server 2003 sp1
->Visual studio 2005


the file is not part of visual Studio 2005
it's user defined code.

so file name and line number doesn't matter.
(if u want then i will give same)

this code is successfully build in visual studio 2002

->I used C++ standard library
->I had not added other's compiler include path
following path is there :
->$(VCInstallDir)include
->$(VCInstallDir)atlmfc\include
->$(VCInstallDir)PlatformSDK\include
->$(FrameworkSDKDir)include

->i had not include <vector> or <vector.h>

p2

.



Relevant Pages

  • Re: xPC target w/ Matlab 2009a - unable to build model
    ... The error message makes me believe that there is some compiler environment/path issue on the PC you are working on. ... When you do a mex -setup are you able to see the Watcom 1.7 compiler? ... Setting environment for using Microsoft Visual Studio 2008 ...
    (comp.soft-sys.matlab)
  • Re: error in compiling 2002 code in 2005
    ... i have code build in visual studio 2002. ... The error message is correct, what you post here is invalid C++. ... message tells you already the solution, you need to add the typename keyword: ... compiler's include paths to your project settings? ...
    (microsoft.public.vc.mfc)
  • Error 07002 - SQLBindParameter Problem Shorter Example
    ... Here is a shorter code example since the last message I posted got ... 'Data Access VB App.exe': Loaded ... The majority of the code was generated by Visual Studio and based on the ... error message it would seem that I have to add SQLBindParameter ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Error 07002 - SQLBindParameter Problem Shorter Example
    ... Cor ... Here is a shorter code example since the last message I posted got ... > The majority of the code was generated by Visual Studio and based on the ... > error message it would seem that I have to add SQLBindParameter ...
    (microsoft.public.dotnet.languages.vb)
  • Error 07002 - SQLBindParameter Problem Shorter Example
    ... Here is a shorter code example since the last one I posted was ... 'Data Access VB App.exe': Loaded ... The majority of the code was generated by Visual Studio and based on the ... error message it would seem that I have to add SQLBindParameter ...
    (microsoft.public.sqlserver.odbc)