Chuck Rolke created QPID-5134:
---------------------------------
Summary: Windows compile error - framing::Buffer::getUInt() not
exported from dll
Key: QPID-5134
URL: https://issues.apache.org/jira/browse/QPID-5134
Project: Qpid
Issue Type: Bug
Components: C++ Broker
Affects Versions: 0.24
Environment: Windows + proton
Reporter: Chuck Rolke
In framing::Buffer.h
{code}
template <int n>
QPID_COMMON_EXTERN uint64_t getUInt();
{code}
In framing::Buffer.cpp
{code}
template <>
uint64_t Buffer::getUInt<1>() {
return getOctet();
}
template <>
uint64_t Buffer::getUInt<2>() {
return getShort();
}
...
{code}
The code fails to link:
{noformat}
error LNK2019: unresolved external symbol
"unsigned __int64 qpid::framing::Buffer::getUInt<4>(void)"
referenced in function
"unsigned int qpid::broker::amqp::OutgoingFromQueue::Record::
getIndex(struct pn_delivery_tag_t)
{noformat}
In previous issues (QPID-2926) windows code has manually generated instances of
the template functions so that the DLL could export them. This time that trick
doesn't work.
Is this code a violation of "The implementation of template functions must be
available in accessible header files to enable the compiler to generate the
code for the concrete type." ?
For completeness there is also a failure sister Buffer::putUInt<n>() functions.
Probably the same fix would be good for both errors.
I can think of some c-style solutions for this problem that would work straight
away...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]