Stefan
Stefan

Reputation: 3859

wchar_t clashing with unsigned short

I am updating our libraries to a newer version and have hit a compilation error:

ClassName &ReturnClass::FuncName(wchar_t *,size_t)' : member function already defined or declared

However it is previously defined as this:

ClassName &ReturnClass::FuncName(unsigned short *,size_t)'

And we have wchar_t as a typedef of unsigned short which seems to be causing the issue.

I have tried using the compiler option wchar_t but that causes masses of errors in the library when it sees the typedef.

I am using nmake to build the code in Windows and MSDEV as a code editor.

Has anyone seen this sort of thing before? How did you solve it?

Upvotes: 4

Views: 1341

Answers (1)

Stefan
Stefan

Reputation: 3859

Okay, the issue has been resolved. The required compiler option was /Zc:wchar_t and not just `wchar_t', although that did resolve the initial issue.

I wsa under the impression that the '/Zc' bit was MS specific and was not required when directly using the clr compiler - DOH!

Upvotes: 1

Related Questions