I would like my C++/CLI headers to compile even when under another platform. Of course I am not expecting to compile them but just ignore them.
Would this be appropriate ? (_MSC_VER)
#ifdef _MSC_VER
using namespace System;
namespace ENMFP {
public ref struct Data {
};
}
#endif
Thanks !
The Common Language Runtime (CLR), the virtual machine component of Microsoft . NET Framework, manages the execution of . NET programs. Just-in-time compilation converts the managed code (compiled intermediate language code) into machine instructions which are then executed on the CPU of the computer.
The . NET framework can work with several programming languages such as C#, VB.NET, C++ and F#.
In the Visual Studio IDE, the /clr compiler option can be individually set on the Configuration Properties > C/C++ > General page of the Property Pages dialog.
To create a CLR console app projectOn the menu bar, choose File > New > Project. In the New Project dialog box, select the Installed > Templates > Visual C++ > CLR node, and then select the CLR Console Application template.
You can use the __cplusplus_cli
predefined macro documented here:
#ifdef __cplusplus_cli
using namespace System;
namespace ENMFP
{
public ref struct Data
{
// ...
};
}
#endif // __cplusplus_cli
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With