Joel Fielder wrote:
>>> To eliminate the warning, replace the declaration of
>>> ResUse::operator= (result.h:92) with the definition of
>>> (result.h:622) so that the function is defined within the class
> body of
>> Without seeing the exact text of the warning, there's no way I'm making
>> that change. I'm not going to just blindly appease the compiler.
> Linker warning:
> warning: 'mysqlpp::ResUse& mysqlpp::ResUse::operator=(const
> mysqlpp::ResUse&)' defined locally after being referenced with dllimport
Oh, it's demented. Result::operator=() never is declared dllimport.
This must have to do with the changes to the way DLL linkage is handled
automatically now. It's incorrectly deciding it's an exported function
instead of an inline one.
I suppose if we have to hoist this inline up into the class definition,
we have to do it for all of them. I don't see anything that would make
this one operator special in that regard.
It's on the Wishlist now, for v2.2.
>> Interesting. I don't understand why you have to do that to classes,
>> since the class proper isn't part of the DLL's interface; only its
>> member functions are.
> My guess is that it's something to do with inheritance, and that placing
> MYSQLPP_EXPORT in front of the class declaration ensures that members
> from the base classes are properly exported also.
>> Do you know if this works with VC++? If it breaks that, I won't be
>> applying it.
> I'm sure it will work:
> http://msdn2.microsoft.com/en-us/library/a90k134d.aspx, but confirmation
> would be nice from someone running Visual C++ :)
The MSDN library is confidence enough for me. It'll certainly get
tested before release, but I don't anticipate problems now. Thanks for
chasing this reference down.