错误 C2733 重载函数“function”的第二个 C 链接不允许
我正在尝试在 Visual Studio 2010 pro 中编译旧的 cpp MFC 项目。
它使用使用 Labview 编译的 dll,我添加此信息是因为我不知道是什么导致了错误消息。
错误消息显示在多个函数上,所有函数都具有相同的错误类型。
error C2733: second C linkage of overloaded function 'function name' not allowed.
“函数名称”包括:“StrCatW”、“StrCmpNW”、“StrCmpW”、“StrCpyNW”和“StrCpyW”
我发现了一个 类似情况网络。
尽管链接中的建议没有解决我的情况,但我仍然看到相同的错误消息。
预先感谢任何试图提供帮助的人。
I am trying to compile old cpp MFC project in Visual Studio 2010 pro.
It uses dll which is compiled using Labview, and I am adding this information because I don't know what is causing the error message..
The error messages show up on multiple functions, all same error type.
error C2733: second C linkage of overloaded function 'function name' not allowed.
the 'function name' includes: 'StrCatW', 'StrCmpNW', 'StrCmpW', 'StrCpyNW', and 'StrCpyW'
I found a similar case on the web.
Although the suggestion in the link didn't solve in my case and I still see the same error messages.
Thanks in advance for anyone trying to help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有MFC的经验,无论如何我会尝试回答。
当使用不同的参数集声明
extern "C"
函数时,会出现此类错误消息。例如:在您的情况下,这两个声明可能与
char*
有关:尝试在您的解决方案中关闭 Unicode 支持:我猜,如果 dll 确实很旧,它会以某种方式声明
StrCatW
与char*
参数,与其他一些声明冲突。如果这没有帮助,请打开预处理输出(据我所知,
/E
编译器开关) - 它将输出一个非常大的文件,因此请查找StrCatW
在其中,也许它会给你一些关于正在发生的事情的线索。I have no experience with MFC, anyway i'll try to answer.
Such error message appears when an
extern "C"
function is declared with a different set of parameters. For example:In your case, the two declarations are probably related to
char*
:Try turning off Unicode support in your solution: i guess, if the dll is really old, it somehow declares
StrCatW
withchar*
arguments, conflicting with some other declaration.If that doesn't help, turn on preprocessed output (
/E
compiler switch, as far as i recall) - it will output a very large file, so look forStrCatW
in it, maybe it will give you some clue on what is going on.