MantisBT - VCMI
View Issue Details
0003147VCMIOtherpublic2020-10-05 23:532023-04-11 09:34
jambolo 
Ivan 
normalminorhave not tried
closedfixed 
MSVC
 
 
0003147: DLL dependency issues
There are several hundred instances of this warning:

warning C4251: 'type1' needs to have dll-interface to be used by clients of class 'type2'
No tags attached.
Issue History
2020-10-05 23:53jamboloNew Issue
2020-10-05 23:58jamboloNote Added: 0007937
2020-10-06 00:01jamboloNote Added: 0007938
2020-10-06 06:18jamboloNote Added: 0007939
2020-10-06 06:22jamboloNote Edited: 0007939bug_revision_view_page.php?bugnote_id=7939#r3611
2023-04-11 09:34IvanNote Added: 0008513
2023-04-11 09:34IvanStatusnew => closed
2023-04-11 09:34IvanAssigned To => Ivan
2023-04-11 09:34IvanResolutionopen => fixed

Notes
(0007937)
jambolo   
2020-10-05 23:58   
As well as several hundred of this warning:

warning C4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
(0007938)
jambolo   
2020-10-06 00:01   
And this warning:

warning C4910: 'boost::iostreams::stream<FileBuf,std::char_traits<char>,std::allocator<char>>': '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
(0007939)
jambolo   
2020-10-06 06:18   
(edited on: 2020-10-06 06:22)
Regarding warning C4251: 'type1' needs to have dll-interface to be used by clients of class 'type2':

This is a problem for C++ standard library. Because much of it is template-based, any differences in configurations (e.g. Debug vs. Release) when building the DLLs can cause bugs and crashes.

Unless somebody has a better solution, the only solution I know of is to remove any C++ standard library features from the DLL interface.

(0008513)
Ivan   
2023-04-11 09:34   
Warning disabled, not relevant