The first sample as follows:
- Code: Select all
#include <windows.h>
#include "Poco/Path.h"
#include "Poco/File.h"
#include "Poco/Exception.h"
#include "Poco/Util/IniFileConfiguration.h"
int WinMain(...)
{
//some code
CreateProcess(...);
//some code
}
when I compile the cpp, I meet a error "error C3861: 'TryEnterCriticalSection': identifier not found".But if I include the header files of POCO before the windows.h like
- Code: Select all
#include "Poco/Path.h"
#include "Poco/File.h"
#include "Poco/Exception.h"
#include "Poco/Util/IniFileConfiguration.h"
#include <windows.h>
then the 'TryEnterCriticalSection' can be found. Why? I have not found any introduction about the order of including header file.
The second sample as follows:
The code is identical with the first sample except that the POCO header file are included before windows.h and I meet anther problem when compile it.
"error C3861: 'CreateProcess' : identifier not found" (But the 'CreateProcessA' is OK.)
And if I delete the '#include "Poco/Util/IniFileConfiguration.h"', compile successfully too.
So why the compiler can not find 'CreateProcess' if I include "Poco/Util/IniFileConfiguration.h" regardless of after or before window.h?





