错误:只有返回类型不同的函数不能重载!建议?

时间:2016-01-23 15:13:24

标签: android c++ build rom

当尝试构建ROM时,它会产生2个错误:

1) functions that differ only in their return type cannot be overloaded extern "C" AudioPolicyInterface* createAudioPolicyManager(AudioPolicyClientInterface *clientInterface); hardware/libhardware_legacy/include/hardware_legacy/AudioPolicyInterface.h:255:34: note: previous declaration is here

2) error: conflicting types for 'destroyAudioPolicyManager' extern "C" void destroyAudioPolicyManager(AudioPolicyInterface *interface);
hardware/libhardware_legacy/include/hardware_legacy/AudioPolicyInterface.h:256:17: note: previous declaration is here

.h文件的链接:http://hastebin.com/polativede.cs

我真的不知道要改变什么来修复这个错误。

1 个答案:

答案 0 :(得分:0)

您正在使用extern "C"作为您的功能。

这意味着您正在为此功能使用 C链接,并且您的代码中不能使用其他具有相同名称的功能。

如果您从未听说过此消息,请参阅此帖 In C++ source, what is the effect of extern "C"?