473,382 Members | 1,665 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,382 software developers and data experts.

C++ Compiler for windows?

Is there a C++ compiler for windows that can be run from the commmandline? I
have only be able to find MS Visual Studio but its rather overkill since I
also like to just use notepad for my code.
Jul 13 '08 #1
13 4170
rufus wrote:
Is there a C++ compiler for windows that can be run from the commmandline? I
have only be able to find MS Visual Studio but its rather overkill since I
also like to just use notepad for my code.

Well,
all of them can be run from command line.

For MS VC, you need to start "Visual Studio 20XX Command prompt" and
after that issue CL command. Alternative would be to start cmd.exe, and
after that execute vcvars32.bat, located in BIN directory of VC
distribution.
Jul 13 '08 #2
On Jul 13, 9:55 am, "rufus" <as...@asd.comwrote:
Is there a C++ compiler for windows that can be run from the commmandline? I
have only be able to find MS Visual Studio but its rather overkill sinceI
also like to just use notepad for my code.
VC++ works fine from the command line. As far as I know, in
fact, it can only be invoked from the command line---Visual
Studios generates a command line to invoke it.

If you've installed Visual C++ correctly, there should be an
entry in your program menus for "Visual Studio 2008 Command
Prompt", or something similar. This will start a console window
with the environment all set up. If you want to use a different
shell (highly recommended), then you'll have to copy the
necessary components of the path into your system path (or the
path of your shell), and define the environment variables LIB
and INCLUDE with the values they have in this window. (I've
used VC++ from the command line in MSys, CygWin and UWin; I
usually invoke it from a gmake file, however, which also works
fine under Windows. If you do use some of the Unix tool set,
however, you might want to consider moving things around so that
there are no spaces in any of the path names---you can make it
work with spaces, but it's a lot more difficult.)

The actual command is cl. Note that like most other compilers,
you'll need a lot of options for it to be really usable.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 13 '08 #3
On 7月13æ—¥, 下åˆ5æ—¶04分, James Kanze <james.ka...@gmail.comwrote:
On Jul 13, 9:55 am, "rufus" <as...@asd.comwrote:
Is there a C++ compiler for windows that can be run from the commmandline? I
have only be able to find Â*MS Visual Studio but its rather overkill since I
also like to just use notepad for my code.

VC++ works fine from the command line. Â*As far as I know, in
fact, it can only be invoked from the command line---Visual
Studios generates a command line to invoke it.

If you've installed Visual C++ correctly, there should be an
entry in your program menus for "Visual Studio 2008 Command
Prompt", or something similar. Â*This will start a console window
with the environment all set up. Â*If you want to use a different
shell (highly recommended), then you'll have to copy the
necessary components of the path into your system path (or the
path of your shell), and define the environment variables LIB
and INCLUDE with the values they have in this window. Â*(I've
used VC++ from the command line in MSys, CygWin and UWin; I
usually invoke it from a gmake file, however, which also works
fine under Windows. Â*If you do use some of the Unix tool set,
however, you might want to consider moving things around so that
there are no spaces in any of the path names---you can make it
work with spaces, but it's a lot more difficult.)

The actual command is cl. Â*Note that like most other compilers,
you'll need a lot of options for it to be really usable.

--
James Kanze (GABI Software) Â* Â* Â* Â* Â* Â* email:james.ka...@gmail.com
Conseils en informatique orientée objet/
Â* Â* Â* Â* Â* Â* Â* Â* Â* Â*Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Sure, cl is the compiler command , as well as rc and link.
On the other hand, you can download a Dev-C++,and put the bin
directory
to your system path,then you can use gcc, g++, etc.
Jul 13 '08 #4

"want.to.be.professer" <gu*********@gmail.comskrev i en meddelelse
news:b7**********************************@c58g2000 hsc.googlegroups.com...
On 7?13?, ??5?04?, James Kanze <james.ka...@gmail.comwrote:
On Jul 13, 9:55 am, "rufus" <as...@asd.comwrote:
Is there a C++ compiler for windows that can be run from the
commmandline? I
have only be able to find MS Visual Studio but its rather overkill since
I
also like to just use notepad for my code.

VC++ works fine from the command line. As far as I know, in
fact, it can only be invoked from the command line---Visual
Studios generates a command line to invoke it.

If you've installed Visual C++ correctly, there should be an
entry in your program menus for "Visual Studio 2008 Command
Prompt", or something similar. This will start a console window
with the environment all set up. If you want to use a different
shell (highly recommended), then you'll have to copy the
necessary components of the path into your system path (or the
path of your shell), and define the environment variables LIB
and INCLUDE with the values they have in this window. (I've
used VC++ from the command line in MSys, CygWin and UWin; I
usually invoke it from a gmake file, however, which also works
fine under Windows. If you do use some of the Unix tool set,
however, you might want to consider moving things around so that
there are no spaces in any of the path names---you can make it
work with spaces, but it's a lot more difficult.)

The actual command is cl. Note that like most other compilers,
you'll need a lot of options for it to be really usable.

--
James Kanze (GABI Software) email:james.ka...@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Sure, cl is the compiler command , as well as rc and link.
On the other hand, you can download a Dev-C++,and put the bin
directory
to your system path,then you can use gcc, g++, etc.

But will the executable compiled with a Dev-C++ gcc or g++ compiler be
executable on windows XP?
Jul 13 '08 #5

"Leclerc" <go*****************@this.inet.hrskrev i en meddelelse
news:g5**********@sunce.iskon.hr...
rufus wrote:
>Is there a C++ compiler for windows that can be run from the
commmandline? I have only be able to find MS Visual Studio but its
rather overkill since I also like to just use notepad for my code.

Well,
all of them can be run from command line.

For MS VC, you need to start "Visual Studio 20XX Command prompt" and after
that issue CL command. Alternative would be to start cmd.exe, and after
that execute vcvars32.bat, located in BIN directory of VC distribution.

Hm this works fine with cmd. But if I try the same with Windows PowerShell
nothing happens when I type "cl.exe", not even an error message.
>

Jul 13 '08 #6
In article <48***********************@news.sunsite.dk>, as***@asd.com
says...
Is there a C++ compiler for windows that can be run from the commmandline? I
have only be able to find MS Visual Studio but its rather overkill since I
also like to just use notepad for my code.
You can still run the compiler with Visual Studio from the command line.
If you prefer something else, there are a few possibilities:

1) Microsoft Platform SDK (http://tinyurl.com/m3nld)
2) Borland (http://www.codegear.com/downloads/free/cppbuilder)
3) Digital mars (http://www.digitalmars.com/download/dmcpp.html)
4) MingW (http://www.mingw.org/node/19)
5) CygWin (http://www.cygwin.com/setup.exe)
6) ConceptGCC (http://www.generic-
programming.org/software/ConceptGCC/download.php)

If you're primarily interested in developing Windows applications and
happen to use C++, MS is probably the best choice -- but otherwise, it's
probably the furthest from conforming with the standard of those listed
here.

If you really wish you were doing your development under Linux, but
happen to be running Windows, CygWin is undoubtedly the best choice --
but otherwise, it's going to be a PITA because it's doing its best to be
BE Linux, despite running under Windows.

If you want to experiment with the latest and greatest language
features, ConceptGCC is almost certainly the best choice -- but
otherwise, it's stupidly slow, allows a lot of code that isn't (yet)
allowed by the standard.

I won't try to go through the strengths and weaknesses of every one, but
you get the general idea...

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jul 13 '08 #7
On Jul 13, 11:21 am, "want.to.be.professer" <guolihui...@gmail.com>
wrote:
On 7月13æ—¥, 下åˆ5æ—¶04分, James Kanze <james.ka...@gmail.comwrote:
On Jul 13, 9:55 am, "rufus" <as...@asd.comwrote:
Is there a C++ compiler for windows that can be run from
the commmandline? I have only be able to find MS Visual
Studio but its rather overkill since I also like to just
use notepad for my code.
VC++ works fine from the command line. As far as I know, in
fact, it can only be invoked from the command line---Visual
Studios generates a command line to invoke it.
If you've installed Visual C++ correctly, there should be an
entry in your program menus for "Visual Studio 2008 Command
Prompt", or something similar. This will start a console window
with the environment all set up. If you want to use a different
shell (highly recommended), then you'll have to copy the
necessary components of the path into your system path (or the
path of your shell), and define the environment variables LIB
and INCLUDE with the values they have in this window. (I've
used VC++ from the command line in MSys, CygWin and UWin; I
usually invoke it from a gmake file, however, which also works
fine under Windows. If you do use some of the Unix tool set,
however, you might want to consider moving things around so that
there are no spaces in any of the path names---you can make it
work with spaces, but it's a lot more difficult.)
The actual command is cl. Note that like most other compilers,
you'll need a lot of options for it to be really usable.
Sure, cl is the compiler command , as well as rc and link.
Never heard of rc, but cl is actually a compiler driver, like
g++ or CC (Sun), or most others. You don't actually invoke
link directly, you do it through cl.
On the other hand, you can download a Dev-C++,and put the bin
directory to your system path,then you can use gcc, g++, etc.
But why? The more or less standard compiler for Windows is
VC++. The only reason I can think of for using g++ under
Windows is portability: you want to use the same sources under
Windows as you did under Linux, without worrying about compiler
idiosyncracies. Whereas I (personally) try to get my code to
compile under as many different compilers as possible.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 13 '08 #8
On Jul 13, 12:10 pm, "rufus" <as...@asd.comwrote:
"want.to.be.professer" <guolihui...@gmail.comskrev i en
meddelelsenews:b7********************************* *@c58g2000hsc.googlegroups.com...
On 7?13?, ??5?04?, James Kanze <james.ka...@gmail.comwrote:
But will the executable compiled with a Dev-C++ gcc or g++
compiler be executable on windows XP?
I'm not sure what Dev-C++ is; I think it's an IDE, like Windows
Studio. But code compiled with g++ under MSys or CygWin on
Windows runs very well under all of the Windows I've tried it
on. (I haven't tried Vista yet, so I don't know. And I've not
tried with some of the older non-professional Windows, either,
before NT technology started being used on the personal systems
as well. But I can state from personal experience that there is
no problem with Windows NT, Windows 2000 or Windows XP.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jul 13 '08 #9
On Jul 13, 2:57 pm, Jerry Coffin <jcof...@taeus.comwrote:
In article <4879b4d6$0$90270$14726...@news.sunsite.dk>,
as...@asd.com says...
[...]
If you're primarily interested in developing Windows
applications and happen to use C++, MS is probably the best
choice -- but otherwise, it's probably the furthest from
conforming with the standard of those listed here.
Is that really true. The only other compiler on your list that
I've worked with is g++, and I'd rate recent versions of g++ and
VC++ fairly close; VC++ still has a few bugs with regards to
some of the more exotic uses of templates, but their library is
probably still slightly better than that of g++. But both are
to a point where you shouldn't notice the difference unless
you're writing very experimental code.

In the distant past: VC++ 6.0 was significantly more conform
than g++ 2.95.2, but there's no reason to use those versions
today.
If you really wish you were doing your development under
Linux, but happen to be running Windows, CygWin is undoubtedly
the best choice -- but otherwise, it's going to be a PITA
because it's doing its best to be BE Linux, despite running
under Windows.
Which is a PITA, even if you're a Unix freak, like I am. If I
want Linux, I know where to get it, and the cost isn't a
deterrant. There's such a thing as an emulation being too
exact; if I'm working under Windows, it's because I need simple
and direct access to the Windows features, and things like
making me type in /cygdrive/c/... rather than just c:/.. don't
help:-). (The worst in this regard is MSys. If an argument
starts with a '/', and the executable isn't in the MSys
directory, it replaces the '/' with 'c:\msys\...'. Which means
that 'cl /help' provokes a very strange error message about not
being able to find the file 'c:\...\help'.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 13 '08 #10
In article <3b2cca50-7a68-43ea-a884-505a92dc5ae9
@m3g2000hsc.googlegroups.com>, ja*********@gmail.com says...
On Jul 13, 2:57 pm, Jerry Coffin <jcof...@taeus.comwrote:
[ ... ]
If you're primarily interested in developing Windows
applications and happen to use C++, MS is probably the best
choice -- but otherwise, it's probably the furthest from
conforming with the standard of those listed here.

Is that really true. The only other compiler on your list that
I've worked with is g++, and I'd rate recent versions of g++ and
VC++ fairly close; VC++ still has a few bugs with regards to
some of the more exotic uses of templates, but their library is
probably still slightly better than that of g++.
Unfortunately, yes, it's really true. Not because Microsoft's compiler
is really that far behind everybody else, but because what they include
with the SDK is version 13.1, where Visual Studio currently comes with
version 15.x.

That's not so old that its conformance is truly terrible or anything
like that, but it's still old enough that I'm pretty sure most of the
others are closer.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jul 13 '08 #11
Jerry Coffin wrote:
In article <3b2cca50-7a68-43ea-a884-505a92dc5ae9
@m3g2000hsc.googlegroups.com>, ja*********@gmail.com says...
>On Jul 13, 2:57 pm, Jerry Coffin <jcof...@taeus.comwrote:

[ ... ]
>>If you're primarily interested in developing Windows
applications and happen to use C++, MS is probably the best
choice -- but otherwise, it's probably the furthest from
conforming with the standard of those listed here.
Is that really true. The only other compiler on your list that
I've worked with is g++, and I'd rate recent versions of g++ and
VC++ fairly close; VC++ still has a few bugs with regards to
some of the more exotic uses of templates, but their library is
probably still slightly better than that of g++.

Unfortunately, yes, it's really true. Not because Microsoft's compiler
is really that far behind everybody else, but because what they include
with the SDK is version 13.1, where Visual Studio currently comes with
version 15.x.

That's not so old that its conformance is truly terrible or anything
like that, but it's still old enough that I'm pretty sure most of the
others are closer.
Pretty sure of something you haven't probably tried in a while.
Compilers evolve... VC++ was far behind the competition until a few
years ago but it has made very fast progresses starting with 7.1
(=.NET 2003, MSC_VER=1310). Have you really tried Digital Mars? Last
time I did --a couple of years ago-- it was _completely_ brain dead;
unusable for anything but toy examples. See e.g. this incredible bug:

<http://www.digitalmars.com/d/archives/c++/beta/596.html>

--
Gennaro Prota | <https://sourceforge.net/projects/breeze/>
Do you need expertise in C++? I'm available.
Jul 13 '08 #12
On Jul 13, 8:04 pm, "Alf P. Steinbach" <al...@start.nowrote:
* James Kanze:
Which is a PITA, even if you're a Unix freak, like I am. If
I want Linux, I know where to get it, and the cost isn't a
deterrant. There's such a thing as an emulation being too
exact; if I'm working under Windows, it's because I need
simple and direct access to the Windows features, and things
like making me type in /cygdrive/c/... rather than just
c:/.. don't help:-). (The worst in this regard is MSys. If
an argument starts with a '/', and the executable isn't in
the MSys directory, it replaces the '/' with 'c:\msys\...'.
Which means that 'cl /help' provokes a very strange error
message about not being able to find the file
'c:\...\help'.)
He he.
Not so funny when you actually have to deal with the problem.
James, have you considered very very exact Microsoft's Windows
Services for Unix (SFU, formerly Interix IIRC) -- it's free,
or at least, was, a few years ago.
This is the first I've heard of it, but I'll look into it. (I'd
also like to try the MKS toolkit; I used it many, many years
back, under MS-DOS, and found it very good. But they've priced
it way out of my budget today.)

Thanks.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 13 '08 #13

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

Similar topics

2
by: Mike Fisher | last post by:
I'm seeing an error when I try to run/debug a web service. Although it doesn't happen every time, it does occur more than half of the times I hit F5. It appears to be returned by the the JIT...
32
by: cat_dog_ass | last post by:
I am used to programming in DOS mode via Borland C++. I would now like to create programs for the Windows envirinment. Is it absoultely necessary to use Visual C++ to do this? Are there other tools...
0
by: Vlad# | last post by:
Hi, I wanted to try out some development for the Windows CE 5.0 platform so downloaded the SmartPhone SDK from Microsoft and started up a new project with a blank form. This is virtually a blank...
1
by: Razzie | last post by:
Hi all, I was working on a little project, worked fine, but now all of a sudden I get: The compiler failed with error code -1073741502 as an error message (when running the site, not...
1
by: keithb | last post by:
This application works without error in the development environment using the VS web server. When I publish the site to my IIS 6.0 server, I get this error at runtime when I open the Change...
1
by: Bruce | last post by:
We suddenly got a mysterious error message on our Windows Server 2003 (SP1) after rolling out a bug fix on a web services application this morning. The application compiles and runs fine on the...
1
by: bhanupoornakumar | last post by:
Hi .. when i am setting a website i am getting the following error.. The compiler failed with error code -1073741819. This is the full error .. u can see below. Compilation Error ...
0
by: gmsieling | last post by:
We're getting compiler error CS0006, with increasing frequency. It says that a randomly named DLL was not found. This happens at random intervals when you try to run the application. We're using the...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
1
by: kmsandeep17 | last post by:
when i host my site on go daddy it give error Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.