struct Pictures
{
IPicture *Picture; // pointer to the picture
int PictureWitdh; // picture witdh (in pixels)
int PictureHeight; // picture height (in pixels)
int PositionX; // the X coordinate of the picture on the Window
int PositionY; // the Y coordinate of the picture on the Window
HWND hWnd; // the handle of the window where the picture is printed on
OLE_XSIZE_HIMETRIC cx; // Amount which will be used for copy horizontally in source picture
OLE_YSIZE_HIMETRIC cy; // Amount which will be used for copy vertically in source picture
struct Pictures *NextPicture; // the pointer to the next picture (if there is one)
struct Pictures *PrevPicture; // the pointer to the previous picture (if there is one)
} *pFirstPicture = NULL;error LNK2005: "struct Pictures * pFirstPicture" (?pFirstPicture@@3PAUPictures@@A) already defined in WebAdmin.obj
Debug/WebAdmin.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
{
IPicture *Picture; // pointer to the picture
int PictureWitdh; // picture witdh (in pixels)
int PictureHeight; // picture height (in pixels)
int PositionX; // the X coordinate of the picture on the Window
int PositionY; // the Y coordinate of the picture on the Window
HWND hWnd; // the handle of the window where the picture is printed on
OLE_XSIZE_HIMETRIC cx; // Amount which will be used for copy horizontally in source picture
OLE_YSIZE_HIMETRIC cy; // Amount which will be used for copy vertically in source picture
struct Pictures *NextPicture; // the pointer to the next picture (if there is one)
struct Pictures *PrevPicture; // the pointer to the previous picture (if there is one)
} *pFirstPicture = NULL;error LNK2005: "struct Pictures * pFirstPicture" (?pFirstPicture@@3PAUPictures@@A) already defined in WebAdmin.obj
Debug/WebAdmin.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
在头文件里能定义全局变量吗?
你试一试在头文件里写 int g_ii;会不会报错?