problem in winnt.h

Hi

I have winnt.h header file in turbo C++.

In this header file I am getting the error.

"Fatal Winnt.h : Error Directive : You need to define a CONTEXT for your CPU"

on the line

#if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
#error You need to define a CONTEXT for your CPU
#endif

I am not able to find out what is the reason for this.

Kindly advice.

Regards
Karan Gupta
Last edited on
Why are you using Turbo C++? That is very old... You should use something newer like Dev-C++ which can be downloaded here: http://www.bloodshed.net/devcpp.html
or Visual C++ express edition: http://www.microsoft.com/express/vc/
These should clear up any problems by having up-to-date libraries and compilers.
Hi

I have down loaded the dev c++. While try to run program I am getting this message

" The system cannot find the file specified "

What can be the reason for that.

Kindly advice.
Regards
Karan
What version of Windows are you using?
Edit: Oh and why are you using winnt.h? As far as I know, that's a pretty old library - you should use windows.h instead.
Last edited on
Hi

I am not using winnt.h. I was using it when I was using turbo C++. But as you suggested I am now using Dev C++. In that I am not able to compile the file.
I am getting this message

" The system cannot find the file specified "

By the way I am using windows XP.

Regards
Karan Gupta
Have you created a project for Dev-C++ or have you just opened your source file? It may help to start a blank project with no files and then add your source file to it and then try compiling.
Hi

Earlier I was compiling a single file but now I have made a project in which I have added a file winspooltest.cpp. there I have added a code

#include <cstdlib>
#include <iostream>
#include <winspool.h>
#include <conio.h>
using namespace std;

int main(int argc, char *argv[])
{
cout<<"Test Page";

getch();
return 0;
}


But when I try to compile the code a alert type window comes and suddenly disappears.

Then I try to run the project I get the message "the project is not compiled."

Regards
Karan
Did you download the version of Dev-C++ that says "with Mingw/GCC" or the one that says "executable only" on the download page? If you downloaded the executable only version then you chose the one without a compiler built in to it, which could cause some problems :P
Hi

There are 3 versions to download

Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC 3.4.2
Dev-C++ 5.0 beta 9.2 (4.9.9.2), executable only (2.4 MB)
Dev-C++ 5.0 beta 9.2 (4.9.9.2), source code (1.6 MB)


in


http://www.bloodshed.net/dev/devcpp.html


which one to download

Regards
Karan Gupta
The one at the top "with Mingw/GCC 3.4.2", that has everything you need to write and compile programs.
Hi

Problem solved. Project runs sucessfully. But I got stuck with some other problem

I have included the header file <winspool.h>

Now I am getting a lot of error.

I am writing one of the error

222 C:\Dev-Cpp\include\winspool.h `LPSTR' does not name a type


What can be the reason for this. Is there anything I have missed during installation.

Kindly advice
Regards
Karan Gupta
Try including windows.h at the very top of your file, before any other include files.
Problem solved.

Thanks for your patience and support :)

Regards
Karan Gupta
Topic archived. No new replies allowed.