tags:

views:

232

answers:

3

Hi,

I cannot find windows.h in my include folder of Turbo C and hence cannot work with the Win32 api's

Can someone please suggest a workaround?

thanks

+4  A: 

Turbo C is a legacy product. I would suggest moving on.

However, the Windows libraries and header files are shipped with the Windows SDK, which you can find on MSDN.

Yann Ramin
I seriously doubt Turbo C is going to be able to compile the headers shipped with the Windows SDK as those headers contain Microsoft extensions.
Billy ONeal
@Billy: You are probably right :)
Yann Ramin
+3  A: 

If you want to work with Win32 APIs, you will probably get the best mileage using Visual Studio (which will have all of the headers and libraries you need). There is even a free edition available.

bta
Can you tell me if I do all the Win32 programming on my machine, would there be any additional requirements on the end users machine to run the executable? It might sound funny, but I am learning.
James
@Jay: It depends on how your application is linked. Visual Studio's compilers rely on the MSVCRT runtime, which can be shipped as a .DLL (there is a redistributable installer for this, and most systems have it), or you can statically link the application and avoid the need for the runtime.
Yann Ramin
@theatrus: woah, dude, simply shipping msvcrtxx as dll can lead to many problems. For example, to runtime error R6034 and infamous "application failed to initialize property". You need to install it (MSVCR90.DLL, MSVCR80.DLL, etc) by running required vcredist_x86.exe which can be downloaded from microsoft. This happens because of manifests introduced by microsoft (in winxpsp2, i believe). On systems where manifests "arent supported" (win2k win2003 server), shipping dlls works. On others (winxp, vista, etc)- it doesn't - by copying dlls you'll get r6034.
SigTerm
@theatrus: or you could use static linking.
SigTerm
@SigTerm: I mentioned static linking and the redistributable installer.
Yann Ramin
+4  A: 

You could download Borland C++ 5.5. If memory serves, it can handle Windows programming "out of the box" (Warning: but it doesn't include an IDE of any kind, only command-line tools).

Alternatively, you could look into any of several alternatives such as Dev-C++, Visual Studio Express, Cygwin, or Digital Mars. Edit: Or Code::Blocks, Ultimate++/TheIDE, NetBeans, or Eclipse CDT.

Jerry Coffin
All good alternatives, except for Dev-C++.
Yann Ramin
@theatrus: I can't say I like Dev-C++ much myself, but it seemed worth mentioning anyway -- some people seem to like it.
Jerry Coffin
Likely [Code::Blocks](http://www.codeblocks.org/) is a better IDE (than Dev-C++) and ships with a more recent MinGW version (that anyway one can install separately), if I remember well.
ShinTakezou
@Shin: I probably should have mentioned Code::Blocks as well. I don't like it much better than Dev-C++ though -- where Dev-C++ is a bit too barebones for my taste, Code::Blocks seems (to me) to suffer from serious feature creep and (in places) poor design. IMO, for an apparent beginner, Dev-C++ is the lesser of the two evils.
Jerry Coffin
Some people said Dev-C++ is not good since it is frozen, while C::B is in active development. Personally, for the stuffs I did on Windows (almost nothing!), Notepad++ is more than enough!
ShinTakezou