- Run without Visual Studio?
- Posted by bleys2002@yahoo.com on January 31st, 2005
I'm sure this is in a FAQ. I apologize, but I can't find it.
I am trying to set up my machine so that I can compile C/C++ programs
using the Win32 API, but without Visual Studio. For the life of me, I
can't figure this out.
I have installed the Platform SDK. I am attempting to use cl from the
(shell shortcut that the SDK installed) to compile a program that uses
windows.h, and it fails with this message:
C:\Program Files\Microsoft SDK\include\Windows.h(157) : fatal error
C1083: Cannot open include file: 'excpt.h': No such file or directory
Now I looked around, and excpt.h does exist in a subdirectory
(C:\Program Files\Microsoft SDK\src\crt), but I found other things on
the web that said I should not add that to %include%.
So, what do I do? Do I need something else? Do I need to modify my
environment?
Thanks and sorry again for the noobish question.
- Posted by xbunny on January 31st, 2005
bleys2002@yahoo.com wrote:
you need to open a command prompt and then run either vcvars32.bat or
vsvars32.bat which will have been installed with Visual Studio. This
will set the environment up for using the tools from the prompt. You
will probably also have to add the Platform SDK to your INCLUDE and LIB
environment variables or pass them on cl's command line.
- Posted by bleys2002@yahoo.com on January 31st, 2005
I don't have Visual Studio, so I don't have the batch files installed
with it.
I have run setenv.bat, which is the equivalent installed with the SDK.
The SDK installer added itself to INCLUDE and LIB.
- Posted by xbunny on January 31st, 2005
bleys2002@yahoo.com wrote:
Got me then! Theres quite a few free complete compilers you could try
such as the free VC Toolkit compiler at
http://msdn.microsoft.com/visualc/vctoolkit2003/ or mingw.
- Posted by bleys2002@yahoo.com on January 31st, 2005
I tried that and uninstalled it before I tried the SDK. It did not
have windows.h in its include directory... Maybe I was looking in the
wrong place?
I'm trying to run the programs in the "Win32 System Programming" book.
- Posted by bleys2002@yahoo.com on January 31st, 2005
I'll try mingw, I've used that before and didn't know it had the
windows libs. Would still be interested in knowing what the MS
flavored solution would be though.
- Posted by Alex Blekhman on January 31st, 2005
'excpt.h' file belongs to CRT (C Runtime Library), which is
proprietary product of compiler vendor. You didn't specify which PSDK
you installed. AFAIK, cl.exe (along with 64-bit CRT) distributed with
PSDK as part of Win64 development. I'm not sure you can build Win32
programs with it.
You need Win32 compiler with CRT. As xbunny suggested, download and
install VC Toolkit 2003 which contains latest Win32 compiler with CRT.
- Posted by bleys2002@yahoo.com on January 31st, 2005
I'll try mingw, I've used that before and didn't know it had the
windows libs. Would still be interested in knowing what the MS
flavored solution would be though.
- Posted by bleys2002@yahoo.com on January 31st, 2005
Sorry for the double post, google is messing with me.
I installed the latest Windows 2003 Server PSDK.
- Posted by xbunny on January 31st, 2005
bleys2002@yahoo.com wrote:
you need to use the platform SDK with it to get the win32 headers.
- Posted by Neil Spence on February 1st, 2005
Why not download Dev C++. It uses the gcc compiler, mingw, and you can do
Win32 API.
Also its completely free, and yes it works fine.
You'll find it here...
http://www.bloodshed.net/download.html
<bleys2002@yahoo.com> wrote in message
news:1107157955.275888.89920@f14g2000cwb.googlegro ups.com...
- Posted by Jussi Jumppanen on February 1st, 2005
bleys2002@yahoo.com wrote:
You will need a compiler/linker toolkit to build the a Win32
program. Fortunately there are quite a few free Win32 compiler
options:
The Digital Mars c/c++ compiler looks very nice:
http://www.digitalmars.com
The old Watcom C/C++ compiler can be found here:
http://www.openwatcom.org
A nice free C/C++ compiler for MS-Windows can be found at:
http://www.mingw.org/
and it will produces a Win32 executable that can be debugged using
the windows version of the gdb debugger. Another non commercial C
compiler alternative is lcc-win32:
http://www.cs.virginia.edu/~lcc-win32/
and the Borland BCC Verison 5.5 c/c++ compiler is now almost
free (you need to supply some user details). Just goto:
http://www.borland.com/bcppbuilder/freecompiler
Even Microsoft is now offering a free (with restrictions) c/c++
compiler:
http://msdn.microsoft.com/visualc/vctoolkit2003/
and as an generic IDE Zeus will support all of them 
Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, Emacs, etc) FTP Text Editor
"The C/C++, Java, HTML, Python, Pascal, PHP, Perl programmer's editor"
Home Page: http://www.zeusedit.com
- Posted by bleys2002@yahoo.com on February 16th, 2005
Thanks for the suggestions, Mingw is working fine for me. The reason I
didn't want to download something like Dev-C++ is that I like editing
in Jedit.