pc網(wǎng)站開發(fā)制作蘇州優(yōu)化排名seo
這個(gè)一個(gè)比較低級的問題,為避免兩次犯這樣的低級錯(cuò)誤,特此記錄。
發(fā)生這個(gè)問題的原因是未包含頭文件,例如:
- test.h
//在頭文件中聲明了導(dǎo)出函數(shù)test()
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus 1*/extern __declspec (dllexport) int __stdcall test();#ifdef __cplusplus
};
#endif /*__cplusplus 2*/
- test.c
int test(){return 0
}
編譯成功,此時(shí)用“dumpbin /EXPORTS”查看編譯的dll,發(fā)現(xiàn)未包含導(dǎo)出函數(shù)test()。
發(fā)生此問題的原因是test.c未包含頭文件test.h
修改test.c如下重新編譯即可
#include "test.h"
int test(){return 0
}
越是簡單的問題越容易犯錯(cuò)。