News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Build error "'HEAP_INFORMATION_CLASS' has not been declared"

Started by yfli, March 28, 2014, 12:07:56 AM

Previous topic - Next topic

yfli

Hi all,

I use Code::Blocks 13.12 to build the latest code. The version of wxWidgets is 2.8.12. I always have such compile error:

mingw32-g++.exe -Wall E:\OpenCode\wxWidgets-2.8.12 -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -iquote.objs\include -I.objs\include -I. -IE:\OpenCode\wxWidgets-2.8.12\include -IE:\OpenCode\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c E:\codeblocksource\codeblocks-head\trunk\src\src\app.cpp -o .objs\src\app.o
E:\codeblocksource\codeblocks-head\trunk\src\src\app.cpp: In function 'void EnableLFH()':
E:\codeblocksource\codeblocks-head\trunk\src\src\app.cpp:788:62: error: 'HEAP_INFORMATION_CLASS' has not been declared
         typedef BOOL  (WINAPI *HeapSetInformation_t)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T);

                                                              ^
E:\codeblocksource\codeblocks-head\trunk\src\src\app.cpp:804:47: error: 'HeapCompatibilityInformation' was not declared in this scope
                 HeapSetInformation_func(h, HeapCompatibilityInformation, &HeapFragValue, sizeof(HeapFragValue));

Thank you in advance.
                                               ^

stahta01

You likely have a broken Compiler or wxWidgets installation or do NOT have WX_PRECOMP defined (but the log you posted has it defined).
Where and How did you do the wxWidgets installation?

It appears to be missing the #include "wx/msw/wrapwin.h" from "wx/wxprec.h" header.
(The wrapwin.h includes windows.h; that includes winnt.h that defines HEAP_INFORMATION_CLASS)

In the app.cpp file try adding the code below between the including <sdk.h> and "app.h".
If it works; likely have wxWidgets issue; if it still fails likely has a bad Compiler.

To confirm compiler try including
#include <windows.h>
or
#include <winnt.h>

Edit 4 or 5: changed __WINDOWS__ to __WXMSW__ in code below.


#include <sdk.h>
#ifndef WX_PRECOMP
   #ifdef __WXMSW__
       #include <wx/msw/wrapwin.h>  // HEAP_INFORMATION_CLASS
   #endif // __WXMSW__
#endif // WX_PRECOMP

#include "app.h"


Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Miguel Gimenez