c++ - #include <Dbghelp.h> doesn't include the header -


if include #include <dbghelp.h> in, example, console c++ application, not bring definitions header file , there more or less similar compiler errors if header not included @ all.

compiler errors looks like:

1>------ build started: project: consoledump, configuration: debug win32 ------ 1>  consoledump.cpp 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(23): error c4430: missing type specifier - int assumed. note: c++ not support default-int 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(23): error c2146: syntax error: missing ';' before identifier 'flags' 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(23): error c2065: 'flags': undeclared identifier 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(23): error c2065: 'minidumpwithfullmemory': undeclared identifier 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(24): error c2065: 'minidumpwithfullmemoryinfo': undeclared identifier 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(25): error c2065: 'minidumpwithhandledata': undeclared identifier 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(26): error c2065: 'minidumpwithunloadedmodules': undeclared identifier 1>e:\projects\vs2015 projects\consoledump\consoledump\consoledump.cpp(27): error c2065: 'minidumpwiththreadinfo': undeclared identifier 

what's going wrong?

you must included <windows.h> before <dbghelp.h>, , if project uses "stdafx.h", must included before else. following correct order:

#include "stdafx.h" #include <windows.h> #include <dbghelp.h> 

also make sure link dbghelp.lib 'project settings' > linker > input > 'additional dependencies'.


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -