VC++.NET without VS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

is there a way to compile the cpp source that i wrote at notepad ???

for example in c# you could use csc.exe or in j# > jsc.exe
 
is there a way to compile the cpp source that i wrote at notepad ???

for example in c# you could use csc.exe or in j# > jsc.exe

You've downloaded and installed the .NET Framework and .NET Framework SDK,
right?

http://www.microsoft.com/downloads/...28-7071-4979-8a67-3cffcb0c2524&displaylang=en

According to a post from a Microsoft rep,
<quote>
The C++ compiler is not shipped with .NET framework, though C++ is a
language supported by .NET. You may get a C++ compiler support Managed
Extension from VS.NET:

Microsoft Visual Studio .NET\Vc7\bin\cl.exe

I hope this information is helpful for you.

Best regards,

Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer
<unquote>

However,
<quote>
C:\Program Files\Microsoft.NET\SDK\v1.1\Bin>cl
Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.2292 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]


C++ complier installed by framework SDK setup in C:\Program Files\Microsoft
Visual Studio .NET 2003\Vc7\bin. You do not need VS.NET to use c++.
Framework SDK does not include windows headers and STL, you will need
download Platform SDK and STLPORT to fix that problem.

http://www.stlport.org/download.html
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm

<unquote>
Hope this helps.
 
thanks a lot i had stucked there... i wrote a basic hello.cpp

#include <iostream>
#include <string>

using namespace std;

int main(){
string name;
cout << "What is your name? ";
cin >> name;
cout << "Welcome, "
<< name << ". and bye"
<< endl;
return EXIT_SUCCESS;
}

C:\netsdk1.1.43\vc++>cl -I"C:\Program Files\Microsoft Visual Studio .NET
2003\Vc
7\include" -EHsc -c hello.cpp
Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

hello.cpp
hello.cpp(1) : fatal error C1083: Cannot open include file: 'iostream': No
such
file or directory
errors...

but i wonder why c# and j# does have compilers inside framework and VC++ not
? isn't it run from CLR by using same libraries???

Peter van der Goes said:
is there a way to compile the cpp source that i wrote at notepad ???

for example in c# you could use csc.exe or in j# > jsc.exe

You've downloaded and installed the .NET Framework and .NET Framework SDK,
right?

http://www.microsoft.com/downloads/...28-7071-4979-8a67-3cffcb0c2524&displaylang=en

According to a post from a Microsoft rep,
<quote>
The C++ compiler is not shipped with .NET framework, though C++ is a
language supported by .NET. You may get a C++ compiler support Managed
Extension from VS.NET:

Microsoft Visual Studio .NET\Vc7\bin\cl.exe

I hope this information is helpful for you.

Best regards,

Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer
<unquote>

However,
<quote>
C:\Program Files\Microsoft.NET\SDK\v1.1\Bin>cl
Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.2292 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]


C++ complier installed by framework SDK setup in C:\Program Files\Microsoft
Visual Studio .NET 2003\Vc7\bin. You do not need VS.NET to use c++.
Framework SDK does not include windows headers and STL, you will need
download Platform SDK and STLPORT to fix that problem.

http://www.stlport.org/download.html
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm

<unquote>
Hope this helps.
 
sadun said:
hello.cpp
hello.cpp(1) : fatal error C1083: Cannot open include file:
'iostream': No such
file or directory

but i wonder why c# and j# does have compilers inside framework and
VC++ not ? isn't it run from CLR by using same libraries???

Unlike other .NET languages, VC++ can target both native (x86) and managed
(MSIL/CLR). So VC++ can use the same CLR as C# and J# and VB.NET, but it
doesn't have to.

The free compiler that's included in the .NET SDK includes sufficient
functionality to write .NET programs. The simple program you wrote uses the
C++ standard library which is not part of .NET and is not included in the
..NET SDK.

Limit your programming to managed C++ using .NET Framework classes and
you'll be fine - but that's a whole different beast than "normal C++" that
you might find in an introductory programming book.

-cd
 
i got it. thank you. do you know where i could get more information about
these diffrences forex. could we build fully binary executable CLR
independed project with VC++.NET in VS2003???. i ordered MS step by step
VC++.NET book for now.
 
i got the point :) there are two kind of VC++.NET Managed (compiled
parameter /clr) and the other :) managed one runs on CLR and basic example
is... (.net sdk should be installed)

//mhello.cpp
#using <mscorlib.dll>

using namespace System;

int main(void)
{
Console::WriteLine("Hello Earth");
}

//---------------------------
compile'in:

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\cl.exe -I"C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include" mhello.cpp -EHsc -c /clr

//---------------------------
link'in:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe
/LIBPATH:"C:\netsdk1.1.43\v1.1\Lib" /LIBPATH:"C:\Program Files\Microsoft
Visual Studio .NET 2003\Vc7\lib" /NOLOGO mhello.obj
 
sadun said:
i got it. thank you. do you know where i could get more information
about these diffrences forex. could we build fully binary executable
CLR independed project with VC++.NET in VS2003???. i ordered MS step
by step VC++.NET book for now.

You can get more information on the differences by looking on MSDN
(msdn.microsoft.com) for "Managed Extensions for C++" and for the .NET
Framework class library documentation.

If you want to make a binary executable that's not dependent on the CLR, you
probably want to get Visual Studio .NET 2003 Professional so that you get an
optimizing compiler, the C++ standard library and ATL and MFC.

-cd
 
Back
Top