Fatal error C1190: managed targeted code requires a '/clr' option

In Visual Studio for C++ code you have two options, managed code or unmanaged code.

Managed code compiles to Intermediate Language that will run on the Common Language Runtime (CLR). Unmanaged code compiles to machine code that runs directly on the computer.

When you try to include any managed code in the unmanaged code and compile you will get this error message. 
To eliminate this error you should use the common runtime support for your code. 
To enable the /clr option for your project in Visual Studio go to:


Project --> Properties-->Configuration Properties-->General-->Common Language Runtime Support.


and select the "Common Language Runtime Support (/clr)". Now save and compile. 


.


No comments:

Post a Comment

Golang: Http POST Request with JSON Body example

Go standard library comes with "net/http" package which has excellent support for HTTP Client and Server.   In order to post JSON ...