User forums > Help
Build error "'HEAP_INFORMATION_CLASS' has not been declared"
(1/1)
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.
--- Code: ---#include <sdk.h>
#ifndef WX_PRECOMP
#ifdef __WXMSW__
#include <wx/msw/wrapwin.h> // HEAP_INFORMATION_CLASS
#endif // __WXMSW__
#endif // WX_PRECOMP
#include "app.h"
--- End code ---
Tim S.
beautylesson:
--- Quote from: stahta01 on March 28, 2014, 07:43:34 am ---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 fnf)
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.
--- Code: ---#include <sdk.h>
#ifndef WX_PRECOMP
#ifdef __WXMSW__
#include <wx/msw/wrapwin.h> // HEAP_INFORMATION_CLASS
#endif // __WXMSW__
#endif // WX_PRECOMP
#include "app.h"
--- End code ---
Tim S.
--- End quote ---
Maybe I need to post this question in another forum topic? For example, in Using Code::Blocks? I really need to configure Code::Blocks to create GTK applications, and in this topic the answer is no.
Miguel Gimenez:
Spam reported to moderator.
Navigation
[0] Message Index
Go to full version