Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling/Running via DOS 2

Status
Not open for further replies.

Jesdisciple

Programmer
Jun 3, 2007
8
0
0
Hello! C++ is completely new for me, so how am I supposed to compile from the command prompt?
 
Since you are in the MS forum, I assume you already have MS compiler installed. If you look at the installation directory (probably somewhere in Program Files/Microsoft Visual Studio/VC??/bin) there is a file called vcvars32.bat

First startup a dos prompt
Then execute vcvars32.bat
The compiler is called cl.exe

If you type cl /? it will tell you all the parameters that it will take.

The linker is called link.exe

If you wish to use make, the make command is called nmake.

All the commands have /? for parameters.
 
No, I don't have that yet, but I found the download on Google and am getting it. (I selected this forum because I use Windows XP.) Thanks!
 
Why not just use their GUI? Probably a lot easier if you're new to it. Supposed to be intuitive but you can be the judge of that being an absolute beginner.
 
What GUI? I'm trying to use NetBeans with the C++ pack, and running from DOS is part of a troubleshooting measure for that.

I have some experience in Java (though I've never compiled in DOS except with Javadoc) and HTML/DHTML. Hopefully, some of this can port to C++.
 
The GUI xwb was talking of is surely "Visual C++ 2005 Express Edition". It is the free edition of Microsoft's C++ IDE. You can use it from the command line as xwb described it. But writing makefiles that are "eatable" by nmake is painful. If you really want to work from the command line, which is a good thing, I strongly recommend the following tools :
- a meta-make, ie a tool that helps you manage the building (compilation/linking and pre/post build steps) of your projects. You can use CMake for this, it is a great meta-make (the KDE project relies on CMake).
- a decent command line interpreter (XP's stinks) : try out MSys or Cygwin which are Win32 ports of a Linux-like environment
- a powerful text editor with source code edition capabilities. There are bunch of them : Emacs, Scite, to name a few.
- a well-designed and feature-rich C++ application framework. For me Qt from Trolltech was one of the best thing that appeared in the C++ world. Moreover you can use it for free as it is also available as an "open source" license (it comes also with its own meta-make utility, named "qmake").

A last thing : if you want to go for Visual C++ 2005 Express Edition, do not forget to download and install the Platform SDK too and follow some post setup steps :
Without these, you won't be able to successfully compile anything!


--
Globos
 
> - a meta-make, ie a tool that helps you manage the
> building (compilation/linking and pre/post build steps) of
> your projects. You can use CMake for this, it is a great
> meta-make (the KDE project relies on CMake).
I have downloaded MinGW (compiler), MSys (supplying a makefile according to ), and NetBeans (IDE, "powerful text editor"), and the following is your only recommendation which I don't believe I have (except maybe the "meta-" in "meta-make") - actually, I don't think I even know what you mean. I'm investigating Qt now.

> - a well-designed and feature-rich C++ application
> framework. For me Qt from Trolltech was one of the best
> thing that appeared in the C++ world. Moreover you can use
> it for free as it is also available as an "open source"
> license (it comes also with its own meta-make utility,
> named "qmake").
 
Qt is free on Linux but it has a price on Windows. Also the Windows version is quite far behind the Linux version.

Qt is OK once you get the hang of it. Takes a while to change your way of thinking for their event driven stuff.
 
xwb said:
Qt is free on Linux but it has a price on Windows.
As I said Qt4 is available as an open-source license and as a commercial license, for all supported platforms (included windows). See Qt/Windows open-source

xwb said:
Also the Windows version is quite far behind the Linux version.
Really? Regarding performance issue? Is it from your personal experience? As I've never tried out Qt on Linux I can't tell you, I only developped with Qt on Windows and all I can say is that it really rocks.

--
Globos
 
It is not a performance issue: just a release issue. Qt Windows was a few versions behind Qt Linux. May have caught up since I last used it (2003). It wasn't open source the last time I used it.

I've since switched over to FLTK which is cross platform and really simple to use.

 
I now have Visual C++ (and Qt but I find no place to type code). I can compile in that IDE, but am wanting to make MinGW visible to the NetBeans C/C++ module. Any thoughts? (I'm following the MinGW mailing list route as well, and have already tried the NetBeans users' list.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top