Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / February 2007

Tip: Looking for answers? Try searching our database.

Suggestion about Bug Fixing of "error C2371: 'WCHAR' : redefinition; different basic types"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mohammad Omer - 14 Feb 2007 10:20 GMT
Hi,

i am developing an application which uses WAB API's, for doing all
this i am using vs2k5. I have wab.h header file included in my project
to use WAB api's but after compilation one error comes like

Error    1    error C2371: 'WCHAR' : redefinition; different basic types    c:
\program files\microsoft visual studio 8\vc\platformsdk\include
\wabdefs.h    78

The error occurs on the following statement, because of redefinition
of 'WCHAR'

#if !defined(UNIX) && !defined(WIN16)
typedef WORD                WCHAR;
#endif

but i know the solution of this problem. it solves by changing project
setting of "Treat wchar_t as Built-in Type" value "No (/Zc:wchar_t-)".
But I am using "Xtreme Toolkit Professional Edition" for making good
look & Feel of an application, when i fix the above problem by
changing project settings a new linking errors come from Xtreme
Toolkit Library. So what i do to fix this problem, in project setting
"Treat wchar_t as Built-in Type" value "yes" and i wrote following
statements where i included wab.h header file.

#define WIN16
 #include "wab.h"
#undef WIN16

and after that my project is working fine and all the things related
to WAB is also working fine. any one guide me, is that the right way
to solve this problem??? and, will this have any effect on the rest of
project??

Regards,

-aims
Bruno van Dooren [MVP VC++] - 14 Feb 2007 12:27 GMT
> but i know the solution of this problem. it solves by changing project
> setting of "Treat wchar_t as Built-in Type" value "No (/Zc:wchar_t-)".
[quoted text clipped - 4 lines]
> "Treat wchar_t as Built-in Type" value "yes" and i wrote following
> statements where i included wab.h header file.

You can change that setting on a per-codefile basis so that only specific
files are compiled with that particular setting.
If you can solve your problems that way it would be the cleanest solution.

> #define WIN16
>  #include "wab.h"
[quoted text clipped - 4 lines]
> to solve this problem??? and, will this have any effect on the rest of
> project??

I wouldn't worry about it. whatever the definition, it is a 16 bit variable
in both cases.
I agree that it isn't the best looking solution, but it should work IF WIN16
has no other impact inside the wab.h file.

Signature

Kind regards,
   Bruno van Dooren
   bruno_nos_pam_van_dooren@hotmail.com
   Remove only "_nos_pam"

Mohammad Omer - 16 Feb 2007 10:09 GMT
Thanks Bruno!

regards,

-aims

On Feb 14, 5:27 pm, "Bruno van Dooren [MVP VC++]"
<bruno_nos_pam_van_doo...@hotmail.com> wrote:
> > but i know the solution of this problem. it solves by changing project
> > setting of "Treat wchar_t as Built-in Type" value "No (/Zc:wchar_t-)".
[quoted text clipped - 29 lines]
>     bruno_nos_pam_van_doo...@hotmail.com
>     Remove only "_nos_pam"

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.