what means C1190: managed targeted code requires a ‘clr’ option in visual C++

December 26, 2007

As I tell you I’m newbie on Visual Studio, I tried to compile mi first hello world just to see if everything is right configured, and I had the following error:

C1190: managed targeted code requires a ‘clr’ optionI found that:
In Visual Studio for C/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) it’s a thing like the JVM for Java. It born with the .Net framework.
Unmanaged code compiles to machine code that runs directly on the computer.

My code needs to run on Windows XP and Windows Mobile, so I found that Windows mobile can have .Net Compact Framework and with this I will have the CLR.

I solved in two ways the issue:
1) With a code that uses a main like this _tmain() (it is to use the managed way) On the name of the project on the Solution explorer, in the general properties y changed the CLR from ‘no’ to ‘CLR old syntax’.
2)Change my code and don’t use _tmain use main() only like the old way (to use it unmanaged) and don’t use CLR properties.

It worked in both ways, so now I have to decide if I will program managed or unmanaged. mmmm I think managed maybe I will have less portability problems and I will not have to worry to free memory because I will have the garbage collector, the problem is that I will reuse some old fuctions I found in a page, I read that I can mix unmanaged and managed code, I think I will do that.

links to know more about:
http://www.developer.com/net/cplus/print.php/2197621

http://www.ondotnet.com/pub/a/dotnet/2003/03/03/mcppp2.html

Entry Filed under: C, visual studio. Tags: , , , .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Categories

Tags

blog bugs C CLR DotNet encrypt forensic google ip address java key matrixssl openssl private key RAM security visual studio webservice wordpress

Blogroll

Feeds