Skip to content

Warning C4575 when compiled as a C++/CLI .Net Core project with Visual Studio 2019 v16.8 #148

Open
@mw4853

Description

@mw4853

If you include a boost header (such as boost/algorithm/string.hpp) that ultimately includes is_funcion_cxx_11.hpp in a C++/CLI .NET Core (NOT the normal .NET Framework) project, you will see a series of compiler warnings similar to the following:

boost-1.74\boost\type_traits\detail\is_function_cxx_11.hpp(114,4): warning C4575: '__vectorcall' incompatible with the '/clr' option: converting to '__stdcall'

struct is_function<Ret __vectorcall(Args...)BOOST_TT_NOEXCEPT_DECL> : public true_type {};

There is no warning here if the C++/CLI project is compiled as .NET Framework instead. It looks like __CLR_VER is defined when building as .NET Framework, but not when building as .NET Core?

How to convert your C++/CLI project to build as .NET Core (instead of the normal .NET Framework):
https://docs.microsoft.com/en-us/dotnet/core/porting/cpp-cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions