error LNK2001:错误解决过程
ReadUsbFileDlg.cpp
F:\XPJ\ReadUsbFile\ReadUsbFileDlg.cpp(213) : warning C4101: ‘pBuf’ : unreferenced local variable
Linking…
ReadUsbFileDlg.obj : error LNK2001: unresolved external symbol “public: __thiscall CPublicFunction::CPublicFunction(void)” ([email protected]@[email protected])
ReadUsbFileDlg.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall CPublicFunction::~CPublicFunction(void)” ([email protected]@[email protected])
ReadUsbFileDlg.obj : error LNK2001: unresolved external symbol “public: bool __thiscall CPublicFunction::NoteTxtLog(class CString,class CString,unsigned long,bool,bool)” ([email protected]@@[email protected]@[email protected])
ReadUsbFileDlg.obj : error LNK2001: unresolved external symbol “public: class CString __thiscall CPublicFunction::GetCurDir(void)” ([email protected]@@[email protected]@XZ)
Debug/ReadUsbFile.exe : fatal error LNK1120: 4 unresolved externals
报这些错是因为没有将public.h和.cpp文件添加到工程中。项目中有#include “public/PublicFunction.h”,所以需要将里面用到的文件添加到当前目录
添加进来之后问题解决