Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I did a simple test on BOOL type as below:

#include <iostream>
#include <windef.h>

int main()
{
    BOOL test=TRUE;

    std::cout << "Hello World!\n";
    std::cout << " test is of BOOL =" << test << std::endl;

}


I got this error message:
Error (active)	E0020	identifier "PSLIST_HEADER" is undefined	....


not sure how to resolve this error and seek help from gurus here.

What I have tried:

I tried to include these header files too:BaseTsd.h, WinNT.h, but it does not help.
Posted
Updated 4-Oct-21 12:32pm

1 solution

Try adding #include <windows.h> before the windef.h header. But unless you need to interact with code using BOOL you should probably use the C++ bool type:
C++
#include <iostream>
#include <iomanip>  //for std::boolaplha

int main()
{
    bool test = true;
    std::cout << "test = " << test << '\n'; // prints "test is 1"
    std::cout <<  std::boolalpha;
    std::cout << "test = " << test << '\n'; // prints "test = true"
}
 
Share this answer
 
Comments
Southmountain 5-Oct-21 9:59am    
thank you very much!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900