7.10
修改完easyX的路徑,只剩下一個問題
【】無法解析的外部符號_iob_func,該符號在函數“”中被引用
【】1個無法解析的外部命令
原因:
版本的問題,代碼已經編譯過了,但是是2012版本的,我的vs是15版本應該是這個原因。
http://tieba.baidu.com/p/4034517162?qq-pf-to=pcqq.c2c從該帖子學習
VS2015中,微軟的標准庫對標准輸入輸出流的宏定義改_ACRTIMP_ALT FILE* __cdecl __acrt_iob_func(unsigned);
#define stdin (__acrt_iob_func(0))
#define stdout (__acrt_iob_func(1))
#define stderr (__acrt_iob_func(2))
在vs2010-2013版本中,微軟的標准庫對標准輸入輸出流的宏定義
_CRTIMP FILE * __cdecl __iob_func(void);
#define stdin (&__iob_func()[0])
#define stdout (&__iob_func()[1])
#define stderr (&__iob_func()[2])
導致EasyX在VS2015 RC 中出現 LNK 2019 無法解析的外部符號 __iob_func 錯誤
靜態庫鏈接出現錯誤__iob_func,重新定義__iob_func數組就可解決此問題。
解決辦法:在easyx.h文件頭加如下定義即可:
#ifdef __cplusplus extern "C" #endif FILE __iob_func[3] = { __acrt_iob_func(0),__acrt_iob_func(1),__acrt_iob_func(2) };
解決完該問題,第二個問題也沒有了~~~~~