简体   繁体   English

wchar_t与unsigned short发生冲突

[英]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. 我们将wchar_t作为unsigned shorttypedef ,这似乎导致了这个问题。

I have tried using the compiler option wchar_t but that causes masses of errors in the library when it sees the typedef . 我已经尝试使用编译器选项wchar_t但是当它看到typedef时会导致库中的大量错误。

I am using nmake to build the code in Windows and MSDEV as a code editor. 我正在使用nmake在Windows和MSDEV中构建代码作为代码编辑器。

Has anyone seen this sort of thing before? 以前有人见过这种事吗? How did you solve it? 你是怎么解决的?

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. 所需的编译器选项是/Zc:wchar_t而不仅仅是`wchar_t',尽管这确实解决了初始问题。

I wsa under the impression that the '/Zc' bit was MS specific and was not required when directly using the clr compiler - DOH! 我的印象是'/ Zc'位是MS特定的,直接使用clr编译器时不需要 - DOH!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM