→ eye5002003: 對,windows動態函式庫的標頭檔都會寫這個 01/02 12:22
https://stackoverflow.com/questions/8863193/what-does-declspecdllimport-really-mean
-----
Sent from JPTT on my Asus ASUS_X00TDB.
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.217.35.97
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1546319244.A.1F7.html
在Microsoft Doc上寫說:
這可以讓compiler知道這個函數或物件是否來自dll,算是dll interface,
如此一來就不需要.def檔。
class __declspec(dllimport) QBasicAtomicInt
{
public: ...
};
像這樣寫就是compiler遇到這個物件的時候就會知道要去dll找,如果沒寫就不知道,所以一定要寫或是用.def檔嗎?
謝謝!
p.s.我參考