'HDIB' : missing storage-class or type specifiers
出现一个问题:
--------------------Configuration: QShowDib - Win32 Debug--------------------
Compiling...
QDib.cpp
d:\qshowdib\qdib.h(15) : error C2146: syntax error : missing ';' before identifier 'm_hDIB'
d:\qshowdib\qdib.h(15) : error C2501: 'HDIB' : missing storage-class or type specifiers
d:\qshowdib\qdib.h(15) : error C2501: 'm_hDIB' : missing storage-class or type specifiers
D:\QShowDib\QDib.cpp(23) : error C2065: 'm_hDIB' : undeclared identifier
D:\QShowDib\QDib.cpp(52) : error C2440: '=' : cannot convert from 'struct HDIB__ *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\QShowDib\QDib.cpp(86) : error C2440: '=' : cannot convert from 'struct HDIB__ *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
QShowDib.cpp
d:\qshowdib\qdib.h(15) : error C2146: syntax error : missing ';' before identifier 'm_hDIB'
d:\qshowdib\qdib.h(15) : error C2501: 'HDIB' : missing storage-class or type specifiers
d:\qshowdib\qdib.h(15) : error C2501: 'm_hDIB' : missing storage-class or type specifiers
QShowDibDoc.cpp
d:\qshowdib\qdib.h(15) : error C2146: syntax error : missing ';' before identifier 'm_hDIB'
d:\qshowdib\qdib.h(15) : error C2501: 'HDIB' : missing storage-class or type specifiers
d:\qshowdib\qdib.h(15) : error C2501: 'm_hDIB' : missing storage-class or type specifiers
QShowDibView.cpp
d:\qshowdib\qdib.h(15) : error C2146: syntax error : missing ';' before identifier 'm_hDIB'
d:\qshowdib\qdib.h(15) : error C2501: 'HDIB' : missing storage-class or type specifiers
d:\qshowdib\qdib.h(15) : error C2501: 'm_hDIB' : missing storage-class or type specifiers
Generating Code...
执行 cl.exe 时出错.
QShowDib.exe - 1 error(s), 0 warning(s)
出错的地方:
// QDib.h: interface for the QDib class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_QDIB_H__506061F8_7436_435B_B817_94C7814FB87F__INCLUDED_)
#define AFX_QDIB_H__506061F8_7436_435B_B817_94C7814FB87F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class QDib
{
protected:
HDIB m_hDIB;
CPalette * m_palDIB;
public:
QDib();
virtual ~QDib();
BOOL Load(LPCTSTR lpszFileName);
BOOL LoadFromResource(UINT nID);
CPalette * GetPalette();
BOOL Show(CDC *pDC,int x,int y,int cx=0,int cy=0);
int Width();
int Height();
void DeleteDIB();
};
#endif // !defined(AFX_QDIB_H__506061F8_7436_435B_B817_94C7814FB87F__INCLUDED_)