Re: Conversion from GCC C++ to Visual C++
From: Dranoel (Dranoel_at_discussions.microsoft.com)
Date: 07/28/04
- Next message: Dranoel: "RE: Conversion from GCC C++ to Visual C++"
- Previous message: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- In reply to: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- Next in thread: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- Reply: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Jul 2004 14:37:20 -0700
"Victor Bazarov" wrote:
> Dranoel wrote:
> > I have a project which has been built and executes under Linux (not sure which C++ compiler) and I have compiled every module without reported error under cygwin/gcc. However, under Visual C++ I get these types of compile errors, for example:
> > a. Compiling...xxx0.cpp
> > C:\...\Vector.h(58) : error C2065: 'value_type' : undeclared identifier
> > C:\...\Vector.h(58) : error C2143: syntax error : missing ';' before 'constant'
> > Error executing cl.exe.
> > on the statement in Vector.h:
> > void clear() { for (int i=0; i<n; i++) v[i] = (value_type)0; }
>
> So, I see 'value_type' used here. How is it declared/defined?
>
> > b. Compiling...xxx1.cpp
> > C:\...\Vector.h(58) : error C2065: 'value_type' : undeclared identifier
>
> The compiler apparently thinks that 'value_type' is undeclared. Do you
> have any proof the compiler is not correct?
>
> > C:\...\Vector.h(58) : error C2143: syntax error : missing ';' before 'constant'
> > C:\...\MiscVector.cpp(310) : error C2665: 'readPtSet' : none of the 2 overloads can convert parameter 2 from type 'class Array<class Vec2<float> >'
> > C:\...\MiscVector.cpp(381) : error C2784: 'template-parameter-1 __cdecl fabs(class Array<`template-parameter-1'>)' : could not deduce template argument for 'class Array<`template-parameter-1'>' from 'float'
> > C:\...\MiscVector.cpp(381) : error C2784: 'template-parameter-1 __cdecl fabs(class Array<`template-parameter-1'>)' : could not deduce template argument for 'class Array<`template-parameter-1'>' from 'float'
> > C:\...\MiscVector.cpp(610) : error C2784: 'template-parameter-1 __cdecl fabs(class Array<`template-parameter-1'>)' : could not deduce template argument for 'class Array<`template-parameter-1'>' from 'float'
> >
> > NOTE AGAIN: this all compiles fine under gcc.
>
> Of "all" you only presented a single line of code. It's impossible to
> make any judgement based on that.
>
> >
> > Can you give me a suggestion on where to go to resolve these type of problems;i.e, is compile under other C++ compilers but not Visual C++.
>
> Yes. Declare 'value_type' so that the compiler knows what it is. Or
> switch to the standard containers instead of your own, home-brewed ones.
> For example, you should probably use std::vector instead of 'Array'
> (whatever that is).
>
> V
>
Thanks, as a test, I had "corrected" a few of the easy ones. The examples were no more than that. The issue is that it compiles elsewhere but not under Visual C++. I could "correct" each reported error (with great difficulty I suspect), but I greatly prefer to determine what setup of Visual C++ will VC++ compatible with gcc. I am not the author of the software; I am charged with making the conversion with only necessary modifications. I am expressly forbidden to unilaterally "correct" errors not reported under more than one compiler.
- Next message: Dranoel: "RE: Conversion from GCC C++ to Visual C++"
- Previous message: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- In reply to: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- Next in thread: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- Reply: Victor Bazarov: "Re: Conversion from GCC C++ to Visual C++"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|