N
N
Nikita Souvel2015-05-26 16:51:20
C++ / C#
Nikita Souvel, 2015-05-26 16:51:20

How to fix C++ compilation error (error C4430: missing type specifier)?

An error occurs while compiling:
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\04-processinfo\toolhelp.h 87 1 04 ProcessInfo
and starting from line 87 is a piece of code that most likely contains an error:

inline CToolhelp::CreateSnapshot(DWORD dwFlags, DWORD dwProcessID) {

   if (m_hSnapshot != INVALID_HANDLE_VALUE)
      CloseHandle(m_hSnapshot);

   if (dwFlags == 0) {
      m_hSnapshot = INVALID_HANDLE_VALUE;
   } else {
      m_hSnapshot = CreateToolhelp32Snapshot(dwFlags, dwProcessID);
   }
   return(m_hSnapshot != INVALID_HANDLE_VALUE);
}

for the full picture:
prntscr.com/79l8d0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2015-05-26
@Souvel1

The return type of the CToolhelp::CreateSnapshot function is not set
By default, C substitutes int, C++ gives an error.

V
Vladimir Martyanov, 2015-05-26
@vilgeforce

inline CToolhelp::CreateSnapshot() - implementation of the method without specifying the return type, but that's what the studio complains about.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question