473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

can i compile and run .cpp file in .net environment as in VC++

Mon
I am confused and dont know how to use .net environment to work with C++. but i am just not sure whether it's possible or not. Can anyone tell me, pls?
Nov 17 '05 #1
1 2978
"Mon" <an*******@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
I am confused and dont know how to use .net
environment to work with C++. but i am just
not sure whether it's possible or not.
Can anyone tell me, pls?


To which environment are you referring - the IDE's or the runtime's?

If you are asking can you use what Microsoft calls "Managed Extensions for
C++" so that you can use the C++ language to build applications which run
under the control of the .Net runtime (i.e. the Common Language Runtime or
CLR) the answer is yes.

Take this program

#include <iostream>
using namespace std;

int main()
{
cout << "Hello, world" << endl;

return 0;
}

and compile it with the command

cl /EHsc /clr hello.cpp

and you get an executable which runs under .Net.

Of course, you can arrive at the same place using (in some sense less
standard) C++:

#using <mscorlib.dll>
using namespace System;

int main()
{
Console::WriteLine(S"Hello, world.");

return 0;
}

Regards,
Will


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dhruv | last post by:
I was wondering if anyone could compile this code for me on VC. The problem that I've run into is that VC++6 does not support templates fully, and so, I cannot get this to compile, which relies...
8
by: Davy | last post by:
Hi all, I use VC and gcc/gdb to compile and debug C/C++ files. But I found some of the debug version of the compiled files are too large to be run in a small RAM. Can I compile C/C++ Debug...
5
by: Michael | last post by:
i experience slower compile times with VC++ 2003 compared to VC+6.0. Anyone experiencing the same? Should that be expected? This ineed matters, when total compilation time is > 1h and you have to...
6
by: Joachim | last post by:
I have the following simple program: #include <iostream> #include <map> #include <string> #include <sstream> #include <fstream> #include <vector> using namespace std;
13
by: Nick Z. | last post by:
Whenever I try to compile a VC++ program using VS .NET 2003 I get an error saying mspdb71.dll not found. How can I fix this error? PS. I ran vsvars32.bat and it did not change a thing. ...
6
by: Arthur | last post by:
I had two Visual Studio .NET C++ solutions that I combined into one. These project solutions were very similar. In fact, the two solutions were sharing many files. Now that they are one...
0
by: ufnuceda | last post by:
Hello everyone, I was wondering if any of you have some experience with the boost library. I am having trouble compiling code with it. Since boost is being used a lot these days I thought some...
2
by: 001 | last post by:
I get the following error when compiling under MS VC++: ------ Build started: Project: pract-1, Configuration: Debug Win32 ------ Compiling... pract-1.cpp Linking... atlsd.lib(atltrace.obj) :...
0
by: dot | last post by:
I spent a few headache filled days trying to use GMP on windows (XP pro) I finally got it to work and since I found little help on the Web I thought someone might find what i did useful. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.