今天引用外來庫時出現問題,也許是版本問題。
錯誤如下:
.....\oursun\cincludes\quickdraw.h(309): error C2011: “Picture”:“struct”類型重定義
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\comdef.h(326) : 參見“Picture”的聲明
其中Picture聲明如下:
__if_not_exists(Picture)
{
struct Picture : IPictureDisp {};
}
struct定義如下:
struct Picture { short picSize; Rect picFrame; }; typedef struct Picture Picture; typedef Picture * PicPtr; typedef PicPtr * PicHandle;
應該是程序版本不一致的問題,暫且不深究什么原因。
解決方法如下:
既然說是重定義,那就另改一個別名了。
struct Picture1 { short picSize; Rect picFrame; }; typedef struct Picture1 Picture1; typedef Picture1 * PicPtr; typedef PicPtr * PicHandle;
ok,問題解決。回家吃飯。