Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Error while building codeblocks src code
Mister_L:
--- Quote from: ollydbg on March 10, 2017, 03:11:43 pm ---OK, I never see this error.
It looks like you are using a MinGW based GCC compiler (Not MinGW-w64based). Maybe the value _WIN32_WINNT is not correctly defined.
You can use the Macro debugging tool to see what is it's value. See http://stackoverflow.com/a/10227059/154911
--- End quote ---
I can confirm the OP's error message during compilation of app.cpp. I'm pretty sure I narrowed the problem down:
* The missing types lie in %MINGW%\include\winnt.h, as noted before, but it is compiler dependend whether they are actually included:
MinGW (8.2.0): winnt.h#L3950 HEAP_INFORMATION_CLASS is only included if _WIN32_WINNT >= _WIN32_WINNT_WINXP // = 0x0501MinGW-w64 (8.1.0):winnt.h#L7546HEAP_INFORMATION_CLASS is included, does not depend on _WIN32_WINNT // not sure about that, I couldn't find any immediate dependeny!
* In the Code::Blocks build, _WIN32_WINNT (and WINVER as well) was not set for build target src, it got a default value from %MINGW%\include\sdkddkver.h. That's bad because the default depends on the compiler:
MinGW (8.2.0): sdkddkver.h#L153 _WIN32_WINNT = _WIN32_WINNT_WIN2K; // = 0x0500MinGW-w64 (8.1.0):sdkddkver.h#L161WINVER = _WIN32_WINNT_WS03; // = 0x0502
MinGW users get a lower default for _WIN32_WINNT and run into the mentioned error. MinGW-w64 users get the higher default value (although that might not even matter) and probably never encounter it.
Solution for MinGW users:
Edit %MINGW%\include\sdkddkver.h#L153 to
--- Code: ---# define _WIN32_WINNT _WIN32_WINNT_WIN7
--- End code ---
and maybe ajust the warning a few lines above. Setting WINVER=0x0601 in Code::Blocks' compiler options lead to a lot of warnings for me.
Navigation
[0] Message Index
[*] Previous page
Go to full version