Archived

This topic is now archived and is closed to further replies.

VC++ .NET == JIT?

This topic is 5145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Bear with me... I''m trying to get my head around all these new concepts of the JIT and managed code and what-not and I have kind of a stupid question... I only use VC++ .NET at school for my programming assignments and I''m currious, does VC++ .NET already produce code for the JIT by default? Or do I have to tell it to do that? Am I already restricted to Managed code?

Share this post


Link to post
Share on other sites
So if I don''t specifically go in and add that switch, I''m still working in unmanaged?

This leads me to another question... If I write a simple console or Win32 app with MSVC++ .NET and don''t use /clr, Should that program work on older versions of windows without the .NET framework?

Share this post


Link to post
Share on other sites
I'm pretty sure that at least in Visual C++.NET (2002), managed extensions are the default. You can change that in the project settings (right-click project in the Solution Explorer -> Properties) under Config Properties->General->"Use Managed Extensions".

edit: Sorry for the redundancy; didn't read Arild's post completely. Also, managed extensions are not default on "Win32 Project"s, but are on "Managed C++ Empty Project" (duh).

And yes, if you turn them off, your EXE can run independent of the .NET framework.

-ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links


[edited by - zealouselixir on November 10, 2003 2:45:01 PM]

Share this post


Link to post
Share on other sites
Yeah, but you might be dependent on the runtime libraries (depends on how you link to them.)

Whats real crappy is supposedly msvcrt7[0|1].dll is incompatible with Windows 95. Yeah, I want the better compiler, but people should be able to run my stuff on Win95 if they still have it.

Share this post


Link to post
Share on other sites
yes the only way you make a .net enabled program (or use the .net framwork) is if you specify the /clr switch or choose it when you start a new project. If you choose any of the win32 projects or mfc projects they will still run "normally" (if you do use a mfc project you have to include the new mfc dll''s)

Share this post


Link to post
Share on other sites
quote:
Original post by antareus
Yeah, but you might be dependent on the runtime libraries (depends on how you link to them.)

Well, of course, but that''s a separate issue. Apart from the Win95 problem you mentioned, distro''ing a runtime DLL is a lot nicer than having to distro the entire framework (mscoree.dll isn''t enough; they actually have to have the whole thing installed, which rather stinks).

Share this post


Link to post
Share on other sites
It sounds to me like you using visual studio to write your c++ applciations, but you aren''t actually using vc++.net, you can write code in c++ within visual studio, and have it compile and run without using any of the .net framework classes. As long as you are doing this, you won''t need to worry about all these extra dependencies and what not. if it compiles in gcc, I''m assuming you are really only making some standard portable type applicaiton, like a console project, as long as you are using the standard tools that are cross compatible, you will be using native code. Only when you explicitly decide to use .net framework classes, or access native classes through the framework, do you use managed code.

it sounds to me that you are not using .net , but just the IDE of vs.net.

Share this post


Link to post
Share on other sites
yeah,

the .NET in VC++.NET doesn''t mean it can only make .NET applications. think of it as VC++ 7 which can also compile .NET programs. it''s not going to trick you into using .NET or subtily alter your code so it has all these run-time dependancies. it compiles you code the way you want it to. it just also lets you do the whole .NET dance. and the optimising compiler is supposedly better than VC++ 6.

-me

Share this post


Link to post
Share on other sites
I know that I''m not using any of the new features and classes and all that from the .NET framework... and (now) I know that I''m not producing managed code... but what I''m really curious about is if VC++ is producing IL code or native machine code...

I''m assuming that if it does produce IL, it only does it if I use that /clr switch... otherwise, what you guys said about my programs being compatible with older versions of windows wouldn''t be true. I guess what really prompted all this in my head was that I''ve been reading about JIT and I was wondering how many programs are being produced today that are already making use of it.

Share this post


Link to post
Share on other sites