天天看點

帶屬性的向前聲明:warning: type attributes are honored only at type definition

帶屬性的向前聲明:

class __attribute__((__dllexport__)) X;

執行

g++ -c -g x.cpp

編譯會收到如下warning:

warning: type attributes are honored only at type definition

使用的GCC版本為:4.1.2,如果是GCC 4.5.1,則warning變更為:

warning: ‘__dllexport__’ attribute directive ignored

繼續閱讀