From: Matthias Meier on
Hi all,

I have converted a project from VC6.0 to VC2005 (MFC). Now I have a
compiling problem. Following error:

error C2079: 'myString' uses undefined class 'CString'.

CString should now be a template in place of a class.

By another project theres is a forward declaration of 'class CString'.
I get the following message:

error C2371: 'CString' : redefinition; different basic types

Thats an indication for the template, but what do I have to do to
compile my project again.

Regards,

Matthias

From: Vipin [MVP] on
looks like a header file path issue. It seems that when you compile, it is
still
picking the afx.h in vc++6.0 while in vs .net2003 it should be a template
pickup from
afxstr.h header file.

Are you building from VS IDE or via a makefile?

--
Vipin Aravind


"Matthias Meier" <ichwarteaufmail(a)yahoo.de> wrote in message
news:1138376386.641366.270770(a)o13g2000cwo.googlegroups.com...
> Hi all,
>
> I have converted a project from VC6.0 to VC2005 (MFC). Now I have a
> compiling problem. Following error:
>
> error C2079: 'myString' uses undefined class 'CString'.
>
> CString should now be a template in place of a class.
>
> By another project theres is a forward declaration of 'class CString'.
> I get the following message:
>
> error C2371: 'CString' : redefinition; different basic types
>
> Thats an indication for the template, but what do I have to do to
> compile my project again.
>
> Regards,
>
> Matthias
>


From: Matthias Meier on
Hi Vipin,

thanks for your answer. I'm building from VS2005 IDE.

Regards,

Matthias

From: Vipin [MVP] on
Firstly do a rebuild all to be sure.

If that doesn't work. Go to c/c++->Prepreocessor, turn on generate
preprocessed file.

your compilation will fail anyway. Go to the directory there will be
corresponding files with
the .i extension. open them and search for CString. See where it is picking
from.

Also see if in the include dir path(compiler option /I), if it is pointing
to Vc6 include directories.

Also check tools->options->projects->vc++ directories->include directories.

I am using vc6 and vs .net 2003 at home and having VS2005 at office.

Since I am at home, I can only troubleshoot from VS.net 2003 perspective.


--
Vipin Aravind

"Matthias Meier" <ichwarteaufmail(a)yahoo.de> wrote in message
news:1138378813.828329.293190(a)g44g2000cwa.googlegroups.com...
> Hi Vipin,
>
> thanks for your answer. I'm building from VS2005 IDE.
>
> Regards,
>
> Matthias
>


From: Alexander Grigoriev on
Don't add 'class' to CString name. It's actually a typedef in VC2002+.

"Matthias Meier" <ichwarteaufmail(a)yahoo.de> wrote in message
news:1138376386.641366.270770(a)o13g2000cwo.googlegroups.com...
> Hi all,
>
> I have converted a project from VC6.0 to VC2005 (MFC). Now I have a
> compiling problem. Following error:
>
> error C2079: 'myString' uses undefined class 'CString'.
>
> CString should now be a template in place of a class.
>
> By another project theres is a forward declaration of 'class CString'.
> I get the following message:
>
> error C2371: 'CString' : redefinition; different basic types
>
> Thats an indication for the template, but what do I have to do to
> compile my project again.
>
> Regards,
>
> Matthias
>