I have the following code:
// --- message_queue.hpp ---
namespace vca {
namespace keystone {
namespace messaging {
class VCA_KEYSTONE_DLL_PUBLIC MessageQueue final {
[...]
Message PeekMessage(); // <-- Declaration
[...]
};
} // namespace messaging
} // namespace keystone
} // namespace vca
// --- message_queue.cpp ---
namespace vca {
namespace keystone {
namespace messaging {
Message MessageQueue::PeekMessage() { // <-- Definition
[...]
}
} // namespace messaging
} // namespace keystone
} // namespace vca
I get the following strange error from MinGW-builds-4.8.1-x64-posix-seh
:
..\..\lib\messaging\src\message_queue.cpp:281:35: error: no
'vca::keystone::messaging::Message vca::keystone::messaging::MessageQueue::PeekMessageA()'
member function declared in class 'vca::keystone::messaging::MessageQueue'
Message MessageQueue::PeekMessage() {
^
The thing that confuses me is why it is saying the PeekMessageA()
function doesn't exist, where did the A
come from?
If I remove the definition, it will compile and I will get the expected linker errors:
lib\messaging\src\task.cpp.1.o: In function
`vca::keystone::messaging::Task::TaskImpl::PeekMessageA()':
../../lib/messaging/src/task.cpp:939:
undefined reference to `vca::keystone::messaging::MessageQueue::PeekMessageA()'
collect2.exe: error: ld returned 1 exit status
This shows that the A
is added to the Task::TaskImpl::PeekMessageA
. What is this A
and why is gcc
not finding the compiling the correct symbol when I build my file?