std::vector needs to have dll-interface to be used by clients of class 'X warning

前端 未结 4 1277
长发绾君心
长发绾君心 2020-12-05 06:29

I\'m trying to make my library exportable as a DLL but I\'m getting a lot of these warnings for one specific class that uses std::vector:

template 

        
4条回答
  •  伪装坚强ぢ
    2020-12-05 06:53

    The usual method of dealing with platform specific stuff like this is to try and restrict all platform specific settings to a handful of low level files/classes, and then use #defines and #ifdef/#ifndef preprocessor directives to add/replace platform specific variations.

    To effectively implement this, you may need an abstraction layer. For example a production system I worked on in the 1990s had a "File System" library. This presented a common interface to the applications and production code, but had to rely on a few platform-specific files. As well as making it easier to compile and maintain, it also made it easier to port to new platforms. A new file hardware vendor or OS flavour? Simply add the settings to the include files and add new directives accordingly.

提交回复
热议问题