Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Visual Studio for native C++ (unmanaged) development?

I am completely new to C++ development and am trying to learn it in Visual Studio. How can I be sure that I am learning only C++ and not the managed extensions? What configuration settings do I need to change? What project types should I stick to? Any other advice?

Side issue:
I have tried turning off Language Extensions under

Project properties -> C/C++ -> Language -> Disable Language Extensions

but this has generated a compiler error:

Error 1 Command line error D8016 : '/Za' and '/clr' command-line options are incompatible

I've no idea what's going on here ..

like image 762
flesh Avatar asked Jul 30 '09 21:07

flesh


People also ask

Is C++ managed or unmanaged?

All code compiled by traditional C/C++ compilers are Unmanaged Code. COM components, ActiveX interfaces, and Win32 API functions are examples of unmanaged code. Managed code is code written in many high-level programming languages that are available for use with the Microsoft .

What is native managed code?

Native code is written in the "native" machine language of the computer that it is running on and is executed directly by the processor. Managed code is written in a special language that requires another program to run (i.e. manage) it.


2 Answers

So long as you stick to project types under "Win32" node in New Project dialog, you will only be dealing with native code. There's no way to accidentally write some managed code in those projects, unless you go into Project Properties and switch project type to managed.

like image 170
Pavel Minaev Avatar answered Sep 22 '22 02:09

Pavel Minaev


The fact that you have /clr switch in there means you're using a .Net project type - you need to choose a "Win32" project type to get a pure C++ project.

Avoid anything calling itself "managed" or "CLR".

like image 30
RichieHindle Avatar answered Sep 25 '22 02:09

RichieHindle