nix
nix copied to clipboard
[win] Have a closer look at C4251
Investigate the warning C4251 on windows (cf. http://msdn.microsoft.com/en-us/library/esew7y1w.aspx )
My reasoning about why this is happened turned out to be correct but the best description, and possible solutions are given here:
- http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
- http://support.microsoft.com/default.aspx?scid=KB;EN-US;168958
I will deal with this mess for the Second Alpha
Yes this is a bit messy - thanks for the helpful links! I think the "unknownroad" article has some feasible solutions:
-Don't use templates: if you can, get rid of the template and you get rid of the problem -Ignore the warning: it seems the VC compiler correctly solves the problem mostly. While this might seem unsafe since it might depend on compiler version, ironically it is safer than the "solution" to explicitly instantiate the template, which might mean double definition if done in more than one used DLL => linker error. -Private STL Containers! While this does not get rid of the warning, it definitely should get rid of any problems, since private members are not accessible to DLL users and thus don't need to be exported.
I personally would propose to go with the 3rd option and ignore the warning - this should be safe as far as I understand. What do you think @gicmo?
@gicmo Currently the C4251 warning only appears inside the HDF5 header H5Exception.h. Is there really something we can do about this?